Package org.reactfx
Class Await<T,F>
- java.lang.Object
-
- org.reactfx.ObservableBase<java.util.function.Consumer<? super T>,T>
-
- org.reactfx.EventStreamBase<Try<T>>
-
- org.reactfx.Await<T,F>
-
- All Implemented Interfaces:
AwaitingEventStream<Try<T>>,EventStream<Try<T>>,Observable<java.util.function.Consumer<? super Try<T>>>,ProperEventStream<Try<T>>,ProperObservable<java.util.function.Consumer<? super Try<T>>,Try<T>>
class Await<T,F> extends EventStreamBase<Try<T>> implements AwaitingEventStream<Try<T>>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiConsumer<F,TriConsumer<T,java.lang.Throwable,java.lang.Boolean>>addCompletionHandlerprivate SuspendableNopendingprivate EventStream<F>source
-
Constructor Summary
Constructors Modifier Constructor Description privateAwait(EventStream<F> source, java.util.function.BiConsumer<F,TriConsumer<T,java.lang.Throwable,java.lang.Boolean>> addCompletionHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static <T> voidaddCompletionHandler(java.util.concurrent.CompletionStage<T> future, TriConsumer<T,java.lang.Throwable,java.lang.Boolean> handler, java.util.concurrent.Executor executor)(package private) static <T> voidaddCompletionHandler(javafx.concurrent.Task<T> t, TriConsumer<T,java.lang.Throwable,java.lang.Boolean> handler)static <T> AwaitingEventStream<Try<T>>awaitCompletionStage(EventStream<java.util.concurrent.CompletionStage<T>> source, java.util.concurrent.Executor clientThreadExecutor)static <T> AwaitingEventStream<Try<T>>awaitTask(EventStream<javafx.concurrent.Task<T>> source)booleanisPending()protected SubscriptionobserveInputs()Starts observing this observable's input(s), if any.javafx.beans.value.ObservableBooleanValuependingProperty()Indicates whether there is a pending event that will be emitted by this stream in the (near) future.-
Methods inherited from class org.reactfx.ObservableBase
addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, newObserver, notifyObservers, notifyObservers, observe, removeObserver, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
Methods inherited from interface org.reactfx.ProperEventStream
defaultNotificationAccumulator, emit
-
Methods inherited from interface org.reactfx.ProperObservable
defaultEquals, defaultHashCode, defaultToString, notifyObservers
-
-
-
-
Field Detail
-
source
private final EventStream<F> source
-
pending
private final SuspendableNo pending
-
addCompletionHandler
private final java.util.function.BiConsumer<F,TriConsumer<T,java.lang.Throwable,java.lang.Boolean>> addCompletionHandler
-
-
Constructor Detail
-
Await
private Await(EventStream<F> source, java.util.function.BiConsumer<F,TriConsumer<T,java.lang.Throwable,java.lang.Boolean>> addCompletionHandler)
-
-
Method Detail
-
awaitCompletionStage
public static <T> AwaitingEventStream<Try<T>> awaitCompletionStage(EventStream<java.util.concurrent.CompletionStage<T>> source, java.util.concurrent.Executor clientThreadExecutor)
-
awaitTask
public static <T> AwaitingEventStream<Try<T>> awaitTask(EventStream<javafx.concurrent.Task<T>> source)
-
addCompletionHandler
static <T> void addCompletionHandler(java.util.concurrent.CompletionStage<T> future, TriConsumer<T,java.lang.Throwable,java.lang.Boolean> handler, java.util.concurrent.Executor executor)
-
addCompletionHandler
static <T> void addCompletionHandler(javafx.concurrent.Task<T> t, TriConsumer<T,java.lang.Throwable,java.lang.Boolean> handler)
-
pendingProperty
public final javafx.beans.value.ObservableBooleanValue pendingProperty()
Description copied from interface:AwaitingEventStreamIndicates whether there is a pending event that will be emitted by this stream in the (near) future. This may mean that an event has occurred that causes this stream to emit an event with some delay, e.g. waiting for a timer or completion of an asynchronous task.- Specified by:
pendingPropertyin interfaceAwaitingEventStream<T>
-
isPending
public final boolean isPending()
- Specified by:
isPendingin interfaceAwaitingEventStream<T>
-
observeInputs
protected final Subscription observeInputs()
Description copied from class:ObservableBaseStarts observing this observable's input(s), if any. This method is called when the number of observers goes from 0 to 1. This method is called beforeObservableBase.newObserver(Object)is called for the first observer.- Specified by:
observeInputsin classObservableBase<java.util.function.Consumer<? super Try<T>>,Try<T>>- Returns:
- subscription used to stop observing inputs. The subscription is unsubscribed (i.e. input observation stops) when the number of observers goes down to 0.
-
-