Package io.temporal.internal.client
Class EagerPaginator<Resp,T>
- java.lang.Object
-
- io.temporal.internal.client.EagerPaginator<Resp,T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
- Direct Known Subclasses:
ListScheduleListDescriptionIterator
public abstract class EagerPaginator<Resp,T> extends java.lang.Object implements java.util.Iterator<T>The main goal for this Iterator implementation is to abstract the functionality of "eager pagination". This implementation requests the next page when we start iterating through the previous page. The main goal of this approach is to reduce a synchronous wait that would otherwise happen when a first element of the next page is requested.
-
-
Constructor Summary
Constructors Constructor Description EagerPaginator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract com.google.protobuf.ByteStringgetNextPageToken(Resp response)booleanhasNext()voidinit()Tnext()protected abstract java.util.concurrent.CompletableFuture<Resp>performRequest(com.google.protobuf.ByteString nextPageToken)protected abstract java.util.List<T>toElements(Resp response)
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<Resp>
-
init
public void init()
-
performRequest
protected abstract java.util.concurrent.CompletableFuture<Resp> performRequest(@Nonnull com.google.protobuf.ByteString nextPageToken)
-
getNextPageToken
protected abstract com.google.protobuf.ByteString getNextPageToken(Resp response)
-
-