public final class DataflowOperator extends DataflowProcessor
Dataflow selectors and operators enable creation of highly concurrent applications yet the abstraction hides the low-level concurrency primitives and exposes much friendlier API. Since selectors and 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 processors used in the network.
actor, INPUTS, listeners, MAX_FORKS, OUTPUTS, STATE_OBJECT, stateObject
Constructor and Description |
---|
DataflowOperator(PGroup group,
java.util.Map channels,
groovy.lang.Closure code)
Creates an operator
After creation the operator needs to be started using the start() method.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
countInputChannels(java.util.Map channels) |
private static boolean |
verifyChannelParameters(java.util.Map channels,
int parameters) |
addDataflowEventListener, bindAllOutputs, bindAllOutputsAtomically, bindAllOutputValues, bindAllOutputValuesAtomically, bindOutput, bindOutput, checkMaxForks, extractInputs, extractOutputs, fireAfterRun, fireAfterStart, fireAfterStop, fireBeforeRun, fireControlMessageArrived, fireCustomEvent, fireMessageArrived, fireMessageSentOut, fireOnException, getOutput, getOutputs, getOutputs, getStateObject, join, registerChannelListenersToAllInputs, removeDataflowEventListener, reportError, shouldBeMultiThreaded, start, start, terminate, terminateAfterNextRun
public DataflowOperator(PGroup group, java.util.Map channels, groovy.lang.Closure code)
group
- The group the thread pool of which o usechannels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputscode
- The operator's body to run each time all inputs have a value to read