Class 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:
    ContinuablePage, CosmosPagedFluxOptions, FeedResponse
    • Method Detail

      • 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​(int preferredPageSize)
        Specified by:
        byPage in class com.azure.core.util.paging.ContinuablePagedFlux<String,​T,​FeedResponse<T>>
      • 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