Groovy Documentation

gpars.dataflow
Class DataFlow

java.lang.Object
  gpars.dataflow.DataFlow

class DataFlow

Contains factory methods to create dataflow actors and starting them.

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


Property Summary
static DataFlowPGroup DATA_FLOW_GROUP

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

 
Constructor Summary
DataFlow()

 
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
 

Property Detail

DATA_FLOW_GROUP

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


 
Constructor Detail

DataFlow

DataFlow()


 
Method Detail

operator

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


start

public 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

public 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.
param:
code The task body to run


 

Groovy Documentation