- All Superinterfaces:
Cont<T>
Handle used to eventually complete an asynchronous operation by invoking a
Cont
inuation. A Call
abstracts over the execution context
in which a Cont
inuation 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 Cont
inuation on an execution
Stage
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Completes thisCall
with avalue
by eventually invoking thebind(T)
method of thisCall
'sCont
inuation.cont()
Returns theCont
inuation that thisCall
completes.void
Completes thisCall
with anerror
by eventually invoking thetrap(Throwable)
method of thisCall
'sCont
inuation.boolean
Tries to complete thisCall
with avalue
, returningtrue
if this operation caused the completion of theCall
; returnsfalse
if thisCall
was already completed.boolean
Tries to complete thisCall
with anerror
, returningtrue
if this operation caused the completion of theCall
; returnsfalse
if thisCall
was already completed.
-
Method Details
-
cont
Returns theCont
inuation that thisCall
completes. -
bind
Completes thisCall
with avalue
by eventually invoking thebind(T)
method of thisCall
'sCont
inuation.- Specified by:
bind
in interfaceCont<T>
- Throws:
ContException
- if thisCall
has already been completed.
-
trap
Completes thisCall
with anerror
by eventually invoking thetrap(Throwable)
method of thisCall
'sCont
inuation.- Specified by:
trap
in interfaceCont<T>
- Throws:
ContException
- if thisCall
has already been completed.
-
tryBind
Tries to complete thisCall
with avalue
, returningtrue
if this operation caused the completion of theCall
; returnsfalse
if thisCall
was already completed. If successful, thebind(T)
method of thisCall
'sCont
inuation will eventually be invoked. -
tryTrap
Tries to complete thisCall
with anerror
, returningtrue
if this operation caused the completion of theCall
; returnsfalse
if thisCall
was already completed. If successful, thetrap(Throwable)
method of thisCall
'sCont
inuation will eventually be invoked.
-