Package org.jtrim2.taskgraph


package org.jtrim2.taskgraph
Defines the core interface for the task graph execution framework. The framework allows for dynamically defining a computations with arbitrary dependencies and execute the computations without blocking using resources to the fullest.

Building a task graph

  1. The possible factories of the computations (called task node factories: TaskFactory) must be declared. These factories only define what is possible to be computed not what actually will be computed.
  2. Once the task node factories were defined, some computation must be declared explicitly to be computed.
  3. After the initial required computations were declared, the framework will automatically create the task execution graph based on the dependencies of the computations.
  4. With the task graph ready, it can be executed, which will eventually notify its CompletionStage after all computations were completed.

Resource constraints

The framework allows restraining resource usage. There are two kinds of resources, the framework recognizes:
  • Resources being used only during a computation of a task node and released after the computation terminates. This resource usage can be limited by appropriate selection of the task executors.
  • Resources associated with the output of computations. Outputs consume resources up until the point, no computation needs them. The management of such resources is the responsibility of the task graph execution implementation.
See Also: