Package org.eclipse.jetty.util
Class Callback.Completable
- Direct Known Subclasses:
ProxyHandler.ProxyResponseListener
- Enclosing interface:
- Callback
A CompletableFuture
that is also a Callback
.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.Nested
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompose
(Consumer<Callback.Completable> consumer) Returns a newCallback.Completable
that, when thisCallback.Completable
succeeds, is passed to the given consumer and then returned.void
Callback invoked when the operation fails.static Callback.Completable
Creates a completable future given a callback.void
Callback invoked when the operation completes.static Callback.Completable
with
(Consumer<Callback.Completable> consumer) Creates a newCompletable
to be consumed by the givenconsumer
, then returns the newly createdCompletable
.Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.Callback
completeWith
-
Constructor Details
-
Completable
public Completable() -
Completable
-
-
Method Details
-
with
Creates a new
Completable
to be consumed by the givenconsumer
, then returns the newly createdCompletable
.- Parameters:
consumer
- the code that consumes the newly createdCompletable
- Returns:
- the newly created
Completable
-
from
Creates a completable future given a callback.- Parameters:
callback
- The nested callback.- Returns:
- a new Completable which will succeed this callback when completed.
-
succeeded
public void succeeded()Description copied from interface:Callback
Callback invoked when the operation completes.
-
failed
Description copied from interface:Callback
Callback invoked when the operation fails.
-
getInvocationType
- Specified by:
getInvocationType
in interfaceInvocable
- Returns:
- The InvocationType of this object
-
compose
Returns a new
Callback.Completable
that, when thisCallback.Completable
succeeds, is passed to the given consumer and then returned.If this
Callback.Completable
fails, the newCallback.Completable
is also failed, and the consumer is not invoked.- Parameters:
consumer
- the consumer that receives theCallback.Completable
- Returns:
- a new
Callback.Completable
passed to the consumer - See Also:
-