Deprecated
Superseded by Suspendable.
| Modifier and Type | Method and Description |
|---|---|
| public Guard | Returns: aGuard instance that can be released to resume
the delivery of invalidation and change events. If this observable
has been invalidated one or more times before the guard is released,
a single notification is passed to invalidation and change listeners
of this observable.
The returned Guard is AutoCloseable, which makes it
convenient to use in try-with-resources.Prevents invalidation and change events from being emitted, until the returned guard is released. |
| public default void | blockWhile(Runnable r)
Runs the given computation, making sure the invalidation and change events are blocked. |
| public default <T> T | blockWhile(Supplier<T> f)
Runs the given computation, making sure the invalidation and change events are blocked. |
| public default Guard |
| block | back to summary |
|---|---|
| public Guard block() Prevents invalidation and change events from being emitted, until the returned guard is released.
| |
| blockWhile | back to summary |
|---|---|
| public default void blockWhile(Runnable r) Runs the given computation, making sure the invalidation and change events are blocked. When done, previous blocked state is restored. Equivalent to
try(Guard g = block()) {
r.run();
}
| |
| blockWhile | back to summary |
|---|---|
| public default <T> T blockWhile(Supplier<T> f) Runs the given computation, making sure the invalidation and change events are blocked. When done, previous blocked state is restored. T t = this.blockWhile(f);is equivalent to
T t;
try(Guard g = block()) {
t = f.get();
}
| |
| guard | back to summary |
|---|---|
| public default Guard guard() Implements org. Equivalent to
| |