Package org.elasticsearch.core
Class CompletableContext<T>
java.lang.Object
org.elasticsearch.core.CompletableContext<T>
- Type Parameters:
T
- the result type
A thread-safe completable context that allows listeners to be attached. This class relies on the
CompletableFuture
for the concurrency logic. However, it does not accept Throwable
as
an exceptional result. This allows attaching listeners that only handle Exception
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener(BiConsumer<T,? super Exception> listener)
boolean
boolean
boolean
boolean
isDone()
-
Constructor Details
-
CompletableContext
public CompletableContext()
-
-
Method Details
-
addListener
-
isDone
public boolean isDone() -
isCompletedExceptionally
public boolean isCompletedExceptionally() -
completeExceptionally
-
complete
-