public interface Suspendable
Observable is Suspendable, it means that its
notification delivery can be suspended temporarily. In that case, what
notifications are delivered when notifications are resumed depends on the
concrete implementation. For example, notifications produced while suspended
may be queued, accumulated, or ignored completely.| Modifier and Type | Method and Description |
|---|---|
static Suspendable |
combine(Suspendable... suspendables)
Returns a Suspendable that combines all the given
Suspendables into one.
|
Guard |
suspend()
Suspends this suspendable object.
|
default Subscription |
suspendWhen(javafx.beans.value.ObservableValue<java.lang.Boolean> condition)
|
default void |
suspendWhile(java.lang.Runnable r)
Runs the given computation while suspended.
|
default <U> U |
suspendWhile(java.util.function.Supplier<U> f)
Runs the given computation while suspended.
|
Guard suspend()
In case of suspendable Observable,
suspends notification delivery for this observable object.
Notifications produced while suspended may be queued for later delivery,
accumulated into a single cumulative notification, or discarded
completely, depending on the concrete implementation.
default void suspendWhile(java.lang.Runnable r)
Equivalent to
try(Guard g = suspend()) {
r.run();
}
default <U> U suspendWhile(java.util.function.Supplier<U> f)
T t = this.suspendWhile(f);is equivalent to
T t;
try(Guard g = suspend()) {
t = f.get();
}
f.default Subscription suspendWhen(javafx.beans.value.ObservableValue<java.lang.Boolean> condition)
condition and stop suspending this Suspendable based
on condition. If at the time of unsubscribing the returned
Subscription this Suspendable was suspended due
to condition being true, it will be resumed.static Suspendable combine(Suspendable... suspendables)