public class ConditionFuture<T> extends Object
CompletableFuture and a Condition.| Constructor and Description |
|---|
ConditionFuture(ScheduledExecutorService timeoutExecutor) |
| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
newConditionStage(Predicate<T> test,
long timeout,
TimeUnit timeUnit)
Create a new
CompletionStage that completes after the first update(Object) call
with a value satisfying the test predicate. |
void |
stop() |
void |
update(T value)
Update the value and complete any outstanding condition stages for which the value satisfies the predicate.
|
void |
updateAsync(T value,
Executor executor)
Update the value and complete any outstanding condition stages for which the value satisfies the predicate.
|
public ConditionFuture(ScheduledExecutorService timeoutExecutor)
public CompletionStage<Void> newConditionStage(Predicate<T> test, long timeout, TimeUnit timeUnit)
CompletionStage that completes after the first update(Object) call
with a value satisfying the test predicate.test - The predicate.timeout - Maximum time to wait for a value satisfying the predicate.timeUnit - Timeout time unit.public void update(T value)
public void updateAsync(T value, Executor executor)
public void stop()
Copyright © 2022 JBoss by Red Hat. All rights reserved.