Interface TaskFunction

  • All Known Subinterfaces:
    Task
    All Known Implementing Classes:
    AbstractTask, AgentModel, AgentNode

    public interface TaskFunction
    Function to invoke as a sequential process on a concurrent execution Stage. Use Stage.task(TaskFunction) to bind a TaskFunction to a Stage, and invoke TaskRef.cue() to schedule the concurrent execution of the sequential task.

    Blocking

    TaskFunction implementations should not perform long running or blocking operations. If a blocking operation needs to be performed, implement a Task that returns true from taskWillBlock() to avoid thread starvation of the execution Stage.
    See Also:
    Task, Stage
    • Method Detail

      • runTask

        void runTask()
        Executes this sequential process. Only one thread at a time will execute runTask for this TaskFunction.