Class ThreadTask
- java.lang.Object
-
- org.jenkinsci.plugins.workflow.cps.ThreadTask
-
- Direct Known Subclasses:
Safepoint
public abstract class ThreadTask extends Object
Execute something in at the point where all CPS threads are at a safe point.Pass this to
Continuable.suspend(Object)
to haveeval(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 ofContinuable.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 ofContinuable.run(Object)
returns with the specified outcome (which is normally what happens withContinuable.suspend(Object)
) call. This is useful if you want to suspend the computation.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description ThreadTask()
-
-
-
Method Detail
-
eval
protected abstract ThreadTaskResult eval(CpsThread cur)
- Parameters:
cur
- the current thread that requested this task.
-
-