Interface TaskRef

All Known Subinterfaces:
TaskContext

public interface TaskRef
External handle to a TaskFunction bound to an execution Stage. A TaskRef is used to cue a task for execution, and to cancel the execution of a cued task. TaskRef is thread safe.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Cancels the task to prevent it from executing.
    boolean
    cue()
    Schedules the task to execute as a sequential process.
    boolean
    Returns true if the task is currently scheduled for execution.
  • Method Details

    • isCued

      boolean isCued()
      Returns true if the task is currently scheduled for execution.
    • cue

      boolean cue()
      Schedules the task to execute as a sequential process. Returns true if this operation caused the scheduling of the task; returns false if the task was already scheduled to execute. TaskFunction.runTask() will be concurrently invoked exactly once for each time cue() returns true, minus the number of times cancel() returns true. The task becomes uncued prior to the invocation of runTask(), enabling the task to re-cue itself while running.
    • cancel

      boolean cancel()
      Cancels the task to prevent it from executing. Returns true if this operation caused the cancellation of the task; returns false if the task was not scheduled to execute.