CosmosPagedFlux<T> Class
- java.
lang. Object - reactor.
core. publisher. Flux - com.
azure. core. util. paging. ContinuablePagedFlux<C,T,P> - com.
azure. cosmos. util. CosmosPagedFlux<T>
- com.
- com.
- reactor.
Type Parameters
- T
The type of elements in a ContinuablePage<C,T>
public class CosmosPagedFlux
extends ContinuablePagedFlux<String,T,FeedResponse<T>>
Cosmos implementation of ContinuablePagedFlux<C,T,P>.
This type is a Flux that provides the ability to operate on pages of type FeedResponse<T> 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<C,T,P>
Method Summary
Modifier and Type | Method and Description |
---|---|
Flux<Feed |
byPage()
Gets a Flux of FeedResponse<T> starting at the first page. |
Flux<Feed |
byPage(int preferredPageSize)
Gets a Flux of FeedResponse<T> starting at the first page requesting each page to contain a number of elements equal to the preferred page size. |
Flux<Feed |
byPage(String continuationToken)
Gets a Flux of FeedResponse<T> beginning at the page identified by the given continuation token. |
Flux<Feed |
byPage(String continuationToken, int preferredPageSize)
Gets a Flux of FeedResponse<T> 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. |
static
Cosmos |
fromList(List<T> items, boolean isChangeFeed)
Creates an instance of a Cosmos |
Cosmos |
handle(Consumer<FeedResponse<T>> newFeedResponseConsumer)
Handle for invoking "side-effects" on each Feed |
void |
subscribe(CoreSubscriber<? super T> coreSubscriber)
Subscribe to consume all items of type |
Methods inherited from ContinuablePagedFlux
Methods inherited from java.lang.Object
Methods inherited from reactor.core.publisher.Flux
Method Details
byPage
public Flux
Gets a Flux of FeedResponse<T> starting at the first page.
Overrides:
CosmosPagedFlux<T>.byPage()Returns:
byPage
public Flux
Gets a Flux of FeedResponse<T> 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.
Overrides:
CosmosPagedFlux<T>.byPage(int preferredPageSize)Parameters:
Returns:
byPage
public Flux
Gets a Flux of FeedResponse<T> beginning at the page identified by the given continuation token.
Overrides:
CosmosPagedFlux<T>.byPage(String continuationToken)Parameters:
Returns:
byPage
public Flux
Gets a Flux of FeedResponse<T> 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.
Overrides:
CosmosPagedFlux<T>.byPage(String continuationToken, int preferredPageSize)Parameters:
Returns:
fromList
public static CosmosPagedFlux
Creates an instance of a CosmosPagedFlux for mocking purposes or when injecting CosmosPagedFlux instances from a different data source
Parameters:
- the list of items to be returned
- a flag indicating whether the CosmosPagedFlux will be returned from a change feed API
Returns:
handle
public CosmosPagedFlux
Handle for invoking "side-effects" on each FeedResponse returned by CosmosPagedFlux
Parameters:
Returns:
subscribe
public void subscribe(CoreSubscriber 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.
Overrides:
CosmosPagedFlux<T>.subscribe(CoreSubscriber<? super T> coreSubscriber)Parameters: