-
- All Known Subinterfaces:
TaskContext
public interface TaskRef
External handle to aTaskFunction
bound to an executionStage
. ATaskRef
is used to cue a task for execution, and to cancel the execution of a cued task.TaskRef
is thread safe.- See Also:
Stage
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
cancel()
Cancels the task to prevent it from executing.boolean
cue()
Schedules the task to execute as a sequential process.boolean
isCued()
Returnstrue
if the task is currently scheduled for execution.
-
-
-
Method Detail
-
isCued
boolean isCued()
Returnstrue
if the task is currently scheduled for execution.
-
cue
boolean cue()
Schedules the task to execute as a sequential process. Returnstrue
if this operation caused the scheduling of the task; returnsfalse
if the task was already scheduled to execute.TaskFunction.runTask()
will be concurrently invoked exactly once for each timecue()
returnstrue
, minus the number of timescancel()
returnstrue
. The task becomes uncued prior to the invocation ofrunTask()
, enabling the task to re-cue itself while running.
-
cancel
boolean cancel()
Cancels the task to prevent it from executing. Returnstrue
if this operation caused the cancellation of the task; returnsfalse
if the task was not scheduled to execute.
-
-