Class PaginationSubscription<ResponseT>

  • All Implemented Interfaces:
    org.reactivestreams.Subscription
    Direct Known Subclasses:
    ItemsSubscription, ResponsesSubscription

    public abstract class PaginationSubscription<ResponseT>
    extends Object
    implements org.reactivestreams.Subscription
    • Field Detail

      • outstandingRequests

        protected AtomicLong outstandingRequests
      • subscriber

        protected final org.reactivestreams.Subscriber subscriber
      • currentPage

        protected volatile ResponseT currentPage
    • Method Detail

      • request

        public void request​(long n)
        Specified by:
        request in interface org.reactivestreams.Subscription
      • handleRequests

        protected abstract void handleRequests()
        Recursive method to deal with requests until there are no outstandingRequests or no more pages.
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.reactivestreams.Subscription
      • hasNextPage

        protected boolean hasNextPage()
      • completeSubscription

        protected void completeSubscription()
      • isTerminated

        protected boolean isTerminated()
      • stopTask

        protected void stopTask()
      • cleanup

        protected void cleanup()