Interface TaskFunction

All Known Subinterfaces:
Task
All Known Implementing Classes:
AbstractTask, AgentModel, AgentNode, MetaEdgeAgent, MetaHostAgent, MetaLaneAgent, MetaMeshAgent, MetaPartAgent
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface 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:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes this sequential process.
  • Method Details

    • runTask

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