@Stability.Internal public class LatestStateSubscription<T> extends Object
Think of it as applying a hypothetical "sampleLatest" operator to the upstream flux before subscribing. In other words, it ignores all but the latest value.
Only one value is processed at a time. The processing happens asynchronously with respect to the Flux.
Requires collaboration with the subscriber; after processing each value, the subscriber must run a callback to signal readiness for the next value.
Modifier and Type | Class and Description |
---|---|
static interface |
LatestStateSubscription.AsyncSubscriber<T> |
Constructor and Description |
---|
LatestStateSubscription(Flux<T> flux,
Scheduler scheduler,
LatestStateSubscription.AsyncSubscriber<T> subscriber) |
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
awaitTermination()
Returns a Mono that completes after the upstream flux terminates
and its final value is completely processed.
|
public LatestStateSubscription(Flux<T> flux, Scheduler scheduler, LatestStateSubscription.AsyncSubscriber<T> subscriber)
Copyright © 2024 Couchbase, Inc.. All rights reserved.