Groovy Documentation

gpars.dataflow
[Groovy] Class DataFlow

java.lang.Object
  gpars.dataflow.DataFlow

abstract class DataFlow

Contains factory methods to create dataflow actors and starting them.

Authors:
Vaclav Pech, Dierk Koenig Date: Jun 4, 2009


Field Summary
static DataFlowPGroup DATA_FLOW_GROUP

The actor group used by all Dataflow Concurrency actors by default.

 
Method Summary
static DataFlowOperator operator(Map channels, groovy.lang.Closure code)

Creates an operator using the default operator actor group

static Actor start(groovy.lang.Closure code)

Creates a new instance of SingleRunActor to run the supplied code.

static void task(groovy.lang.Closure code)

Creates a new task assigned to a thread from the default dataflow actor group.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

DATA_FLOW_GROUP

public static final DataFlowPGroup DATA_FLOW_GROUP
The actor group used by all Dataflow Concurrency actors by default.


 
Method Detail

operator

static DataFlowOperator operator(Map channels, groovy.lang.Closure code)
Creates an operator using the default operator actor group
Parameters:
channels - A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataFlowStream or DataFlowVariable classes) to use for inputs and outputs
code - The operator's body to run each time all inputs have a value to read


start

static Actor start(groovy.lang.Closure code)
Creates a new instance of SingleRunActor to run the supplied code. In general cases prefer task() instead, which is more lightweight.


task

static void task(groovy.lang.Closure code)
Creates a new task assigned to a thread from the default dataflow actor group. Tasks are a lightweight version of dataflow operators, which do not define their communication channels explicitly, but can only exchange data using explicit DataFlowVariables and Streams.
Parameters:
code - The task body to run


 

Groovy Documentation