|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgpars.dataflow.operator.DataFlowOperator
final class DataFlowOperator
Dataflow operators form the basic units in dataflow networks. Operators are typically combined into oriented graphs that transform data. They accept a set of input and output dataflow channels so that once values are available to be consumed in all the input channels the operator's body is triggered on the values, potentially generating values for the output channels. The output channels at the same time are suitable to be used as input channels by some other dataflow operators. The channels allow operators to communicate. Dataflow operators enable creation of highly concurrent applications yet the abstraction hides the low-level concurrency primitives and exposes much friendlier API. Since operators internally leverage the actor implementation, they reuse a pool of threads and so the actual number of threads used by the calculation can be kept much lower than the actual number of operators used in the network.
Method Summary | |
---|---|
void
|
bindOutput(int idx, def value)
Used by the operator's body to send a value to the given output channel |
void
|
bindOutput(def value)
Used by the operator's body to send a value to the first / only output channel |
def
|
getOutput()
The operator's first / only output channel |
def
|
getOutputs(int idx)
The operator's output channel of the given index |
def
|
getOutputs()
The operator's output channel of the given index |
void
|
join()
Joins the operator waiting for it to finish |
protected void
|
reportError(Throwable e)
Is invoked in case the actor throws an exception. |
DataFlowOperator
|
start(PGroup group)
Starts an operator using the specified operator actor group |
void
|
stop()
Stops the operator |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
void bindOutput(int idx, def value)
void bindOutput(def value)
def getOutput()
def getOutputs(int idx)
def getOutputs()
void join()
protected void reportError(Throwable e)
DataFlowOperator start(PGroup group)
group
- The operator actor group to use with the operator
void stop()
Groovy Documentation