- All Superinterfaces:
Cont<T>
Handle used to eventually complete an asynchronous operation by invoking a
Continuation. A Call abstracts over the execution context
in which a Continuation runs. Think of a Call as a way to
asynchronously invoke Cont.bind(T), and
Cont#trap(Throwable). Use Stage.call(Cont) to get a Call
that asynchronously executes a Continuation on an execution
Stage.-
Method Summary
Modifier and TypeMethodDescriptionvoidCompletes thisCallwith avalueby eventually invoking thebind(T)method of thisCall'sContinuation.cont()Returns theContinuation that thisCallcompletes.voidCompletes thisCallwith anerrorby eventually invoking thetrap(Throwable)method of thisCall'sContinuation.booleanTries to complete thisCallwith avalue, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed.booleanTries to complete thisCallwith anerror, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed.
-
Method Details
-
cont
Returns theContinuation that thisCallcompletes. -
bind
Completes thisCallwith avalueby eventually invoking thebind(T)method of thisCall'sContinuation.- Specified by:
bindin interfaceCont<T>- Throws:
ContException- if thisCallhas already been completed.
-
trap
Completes thisCallwith anerrorby eventually invoking thetrap(Throwable)method of thisCall'sContinuation.- Specified by:
trapin interfaceCont<T>- Throws:
ContException- if thisCallhas already been completed.
-
tryBind
Tries to complete thisCallwith avalue, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed. If successful, thebind(T)method of thisCall'sContinuation will eventually be invoked. -
tryTrap
Tries to complete thisCallwith anerror, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed. If successful, thetrap(Throwable)method of thisCall'sContinuation will eventually be invoked.
-