-
- All Superinterfaces:
Cont<T>
public interface Call<T> extends Cont<T>
Handle used to eventually complete an asynchronous operation by invoking aContinuation. ACallabstracts over the execution context in which aContinuation runs. Think of aCallas a way to asynchronously invokeCont.bind(T), andCont#trap(Throwable). UseStage.call(Cont)to get aCallthat asynchronously executes aContinuation on an executionStage.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbind(T value)Completes thisCallwith avalueby eventually invoking thebind(T)method of thisCall'sContinuation.Cont<T>cont()Returns theContinuation that thisCallcompletes.voidtrap(Throwable error)Completes thisCallwith anerrorby eventually invoking thetrap(Throwable)method of thisCall'sContinuation.booleantryBind(T value)Tries to complete thisCallwith avalue, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed.booleantryTrap(Throwable error)Tries to complete thisCallwith anerror, returningtrueif this operation caused the completion of theCall; returnsfalseif thisCallwas already completed.
-
-
-
Method Detail
-
bind
void bind(T value)
Completes thisCallwith avalueby eventually invoking thebind(T)method of thisCall'sContinuation.- Specified by:
bindin interfaceCont<T>- Throws:
ContException- if thisCallhas already been completed.
-
trap
void trap(Throwable error)
Completes thisCallwith anerrorby eventually invoking thetrap(Throwable)method of thisCall'sContinuation.- Specified by:
trapin interfaceCont<T>- Throws:
ContException- if thisCallhas already been completed.
-
tryBind
boolean tryBind(T value)
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
boolean tryTrap(Throwable error)
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.
-
-