Package org.infinispan.util.concurrent
Class ConditionFuture<T>
java.lang.Object
org.infinispan.util.concurrent.ConditionFuture<T>
A mixture between a
CompletableFuture
and a Condition
.- Since:
- 10.1
- Author:
- Dan Berindei
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnewConditionStage
(Predicate<T> test, long timeout, TimeUnit timeUnit) newConditionStage
(Predicate<T> test, Supplier<Exception> exceptionGenerator, long timeout, TimeUnit timeUnit) Create a newCompletionStage
that completes after the firstupdate(Object)
call with a value satisfying thetest
predicate.void
stop()
void
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.
-
Constructor Details
-
ConditionFuture
-
-
Method Details
-
newConditionStage
-
newConditionStage
public CompletionStage<Void> newConditionStage(Predicate<T> test, Supplier<Exception> exceptionGenerator, long timeout, TimeUnit timeUnit) Create a newCompletionStage
that completes after the firstupdate(Object)
call with a value satisfying thetest
predicate.- Parameters:
test
- The predicate.exceptionGenerator
- Exception generator for timeout errors.timeout
- Maximum time to wait for a value satisfying the predicate.timeUnit
- Timeout time unit.
-
update
Update the value and complete any outstanding condition stages for which the value satisfies the predicate. -
updateAsync
Update the value and complete any outstanding condition stages for which the value satisfies the predicate. -
stop
public void stop()
-