Package org.reactfx
Interface CompletionStageStream<T>
-
- All Superinterfaces:
EventStream<java.util.concurrent.CompletionStage<T>>
,Observable<java.util.function.Consumer<? super java.util.concurrent.CompletionStage<T>>>
- All Known Implementing Classes:
MappedToCompletionStageStream
public interface CompletionStageStream<T> extends EventStream<java.util.concurrent.CompletionStage<T>>
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default AwaitingEventStream<Try<T>>
await()
Returns a new stream that emits the results of completions stages emitted from this stream when they become available.default AwaitingEventStream<Try<T>>
await(java.util.concurrent.Executor clientThreadExecutor)
A variant ofawait()
for streams that do not live on the JavaFX application thread.default AwaitingEventStream<Try<T>>
awaitLatest()
Similar toawait()
, with one difference: for completion stages s1 and s2 emitted from this stream in this order, if s2 arrives before s1 is completed, then the result of s1 is discarded (i.e.default AwaitingEventStream<Try<T>>
awaitLatest(java.util.concurrent.Executor clientThreadExecutor)
A variant ofawaitLatest()
for streams that do not live on the JavaFX application thread.default AwaitingEventStream<Try<T>>
awaitLatest(EventStream<?> canceller)
Similar toawaitLatest()
, with one addition: When an event is emitted fromcanceller
, if the completion stage most recently emitted from this stream has not yet completed, its result is discarded (i.e.default AwaitingEventStream<Try<T>>
awaitLatest(EventStream<?> canceller, java.util.concurrent.Executor clientThreadExecutor)
A variant ofawaitLatest(EventStream)
for streams that do not live on the JavaFX application thread.-
Methods inherited from interface org.reactfx.EventStream
accumulate, accumulate, accumulate, accumulateBetween, accumulateBetween, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateUntilLater, accumulateWhen, accumulateWhen, accumulative, accumulative, cast, conditionOn, conditionOnShowing, distinct, emitBothOnEach, emitOn, emitOnEach, feedTo, feedTo, filter, filter, filterMap, filterMap, flatMap, forgetful, fork, guardedBy, hook, latestN, map, mapToCompletionStage, mapToTask, onRecurseAccumulate, onRecurseAccumulate, onRecurseQueue, onRecurseReduce, onRecurseRetainLatest, or, pausable, pauseWhen, pin, queueBetween, queueUntilLater, queueUntilLater, reduceBetween, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceSuccessions, reduceUntilLater, reduceUntilLater, reduceWhen, reducible, repeatOn, retainLatestBetween, retainLatestUntilLater, retainLatestUntilLater, retainLatestWhen, splitBy, subscribe, subscribeFor, subscribeForOne, successionEnds, successionEnds, supply, supply, supplyCompletionStage, supplyTask, suppressible, suppressWhen, suspenderOf, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenAccumulateFor, thenIgnoreFor, thenIgnoreFor, thenReduceFor, thenReduceFor, thenRetainLatestFor, thenRetainLatestFor, threadBridge, threadBridgeFromFx, threadBridgeToFx, toBinding, withDefaultEvent
-
Methods inherited from interface org.reactfx.Observable
addObserver, observe, removeObserver
-
-
-
-
Method Detail
-
await
default AwaitingEventStream<Try<T>> await()
Returns a new stream that emits the results of completions stages emitted from this stream when they become available.Note that results from the returned stream may arrive in different order than the completion stages emitted from this stream, due to asynchrony.
If a completion stage emitted by this stream fails with exception
e
,Try.failure(e)
is emitted from the returned stream.
-
await
default AwaitingEventStream<Try<T>> await(java.util.concurrent.Executor clientThreadExecutor)
A variant ofawait()
for streams that do not live on the JavaFX application thread.- Parameters:
clientThreadExecutor
- single-thread executor that executes actions on the same thread on which this event stream lives.- See Also:
await()
-
awaitLatest
default AwaitingEventStream<Try<T>> awaitLatest()
Similar toawait()
, with one difference: for completion stages s1 and s2 emitted from this stream in this order, if s2 arrives before s1 is completed, then the result of s1 is discarded (i.e. not emitted from the returned stream).- See Also:
await()
-
awaitLatest
default AwaitingEventStream<Try<T>> awaitLatest(java.util.concurrent.Executor clientThreadExecutor)
A variant ofawaitLatest()
for streams that do not live on the JavaFX application thread.- Parameters:
clientThreadExecutor
- single-thread executor that executes actions on the same thread on which this event stream lives.- See Also:
awaitLatest()
-
awaitLatest
default AwaitingEventStream<Try<T>> awaitLatest(EventStream<?> canceller)
Similar toawaitLatest()
, with one addition: When an event is emitted fromcanceller
, if the completion stage most recently emitted from this stream has not yet completed, its result is discarded (i.e. not emitted from the returned stream).- Parameters:
canceller
- An event from this stream causes the currently expected result (if any) to be discarded. It can be used to signal that a new completion stage will arrive from this stream shortly, which makes the currently expected result outdated.- See Also:
awaitLatest()
-
awaitLatest
default AwaitingEventStream<Try<T>> awaitLatest(EventStream<?> canceller, java.util.concurrent.Executor clientThreadExecutor)
A variant ofawaitLatest(EventStream)
for streams that do not live on the JavaFX application thread.- Parameters:
clientThreadExecutor
- single-thread executor that executes actions on the same thread on which this event stream lives.- See Also:
awaitLatest(EventStream)
-
-