Class LatestStateSubscription<T>

java.lang.Object
com.couchbase.client.core.util.LatestStateSubscription<T>

@Internal public class LatestStateSubscription<T> extends Object
Useful when only the latest value of a Flux is interesting, and processing values is relatively expensive.

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.

  • Constructor Details

  • Method Details

    • awaitTermination

      public Mono<Void> awaitTermination()
      Returns a Mono that completes after the upstream flux terminates and its final value is completely processed.