Class EagerPaginator<Resp,T>

java.lang.Object
io.temporal.internal.client.EagerPaginator<Resp,T>
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
ListScheduleListDescriptionIterator

public abstract class EagerPaginator<Resp,T> extends Object implements 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 Details

    • EagerPaginator

      public EagerPaginator()
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Resp>
    • next

      public T next()
      Specified by:
      next in interface Iterator<Resp>
    • init

      public void init()
    • performRequest

      protected abstract CompletableFuture<Resp> performRequest(@Nonnull com.google.protobuf.ByteString nextPageToken)
    • getNextPageToken

      protected abstract com.google.protobuf.ByteString getNextPageToken(Resp response)
    • toElements

      protected abstract List<T> toElements(Resp response)