public abstract class ThreadTask extends Object
Pass this to Continuable.suspend(Object)
to have eval(CpsThread)
invoked.
eval(CpsThread)
can return in one of two ways.
If the eval method returns with
ThreadTaskResult.resumeWith(Outcome)
, then the calling CPS program sees
the invocation of Continuable.suspend(Object)
"return"
(in the async sense) with the specified outcome. This is useful if you want to
keep the CPS evaluation going.
If the method return with ThreadTaskResult.suspendWith(Outcome)
, then
the synchronous caller of Continuable.run(Object)
returns with the specified
outcome (which is normally what happens with Continuable.suspend(Object)
) call.
This is useful if you want to suspend the computation.
Constructor and Description |
---|
ThreadTask() |
protected abstract ThreadTaskResult eval(CpsThread cur)
cur
- the current thread that requested this task.Copyright © 2016–2020. All rights reserved.