Class CosmosPagedFlux<T>

java.lang.Object
reactor.core.publisher.Flux<T>
com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
com.azure.cosmos.util.CosmosPagedFlux<T>
Type Parameters:
T - The type of elements in a ContinuablePage
All Implemented Interfaces:
org.reactivestreams.Publisher<T>, CorePublisher<T>

public final class CosmosPagedFlux<T> extends com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
Cosmos implementation of ContinuablePagedFlux.

This type is a Flux that provides the ability to operate on pages of type FeedResponse and individual items in such pages. This type supports String type continuation tokens, allowing for restarting from a previously-retrieved continuation token.

For more information on the base type, refer ContinuablePagedFlux

See Also:
  • Method Details

    • handle

      public CosmosPagedFlux<T> handle(Consumer<FeedResponse<T>> newFeedResponseConsumer)
      Handle for invoking "side-effects" on each FeedResponse returned by CosmosPagedFlux
      Parameters:
      newFeedResponseConsumer - handler
      Returns:
      CosmosPagedFlux instance with attached handler
    • byPage

      public Flux<FeedResponse<T>> byPage()
      Description copied from class: com.azure.core.util.paging.ContinuablePagedFlux
      Gets a Flux of ContinuablePage starting at the first page.
      Specified by:
      byPage in class com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
      Returns:
      A Flux of ContinuablePage.
    • byPage

      public Flux<FeedResponse<T>> byPage(String continuationToken)
      Description copied from class: com.azure.core.util.paging.ContinuablePagedFlux
      Gets a Flux of ContinuablePage beginning at the page identified by the given continuation token.
      Specified by:
      byPage in class com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
      Parameters:
      continuationToken - A continuation token identifying the page to select.
      Returns:
      A Flux of ContinuablePage.
    • byPage

      public Flux<FeedResponse<T>> byPage(int preferredPageSize)
      Description copied from class: com.azure.core.util.paging.ContinuablePagedFlux
      Gets a Flux of ContinuablePage starting at the first page requesting each page to contain a number of elements equal to the preferred page size.

      The service may or may not honor the preferred page size therefore the client MUST be prepared to handle pages with different page sizes.

      Specified by:
      byPage in class com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
      Parameters:
      preferredPageSize - The preferred page size.
      Returns:
      A Flux of ContinuablePage.
    • byPage

      public Flux<FeedResponse<T>> byPage(String continuationToken, int preferredPageSize)
      Description copied from class: com.azure.core.util.paging.ContinuablePagedFlux
      Gets a Flux of ContinuablePage beginning at the page identified by the given continuation token requesting each page to contain the number of elements equal to the preferred page size.

      The service may or may not honor the preferred page size therefore the client MUST be prepared to handle pages with different page sizes.

      Specified by:
      byPage in class com.azure.core.util.paging.ContinuablePagedFlux<String,T,FeedResponse<T>>
      Parameters:
      continuationToken - A continuation token identifying the page to select.
      preferredPageSize - The preferred page size.
      Returns:
      A Flux of ContinuablePage.
    • subscribe

      public void subscribe(CoreSubscriber<? super T> coreSubscriber)
      Subscribe to consume all items of type T in the sequence respectively. This is recommended for most common scenarios. This will seamlessly fetch next page when required and provide with a Flux of items.
      Specified by:
      subscribe in interface CorePublisher<T>
      Specified by:
      subscribe in class Flux<T>
      Parameters:
      coreSubscriber - The subscriber for this CosmosPagedFlux