public final class DataflowPrioritySelector extends DataflowSelector
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.
Priority selectors prefer to select messages from channels with lower position index.
guards, select
actor, INPUTS, listeners, MAX_FORKS, OUTPUTS, STATE_OBJECT, stateObject
Constructor and Description |
---|
DataflowPrioritySelector(PGroup group,
java.util.Map<java.lang.String,java.lang.Object> channels,
groovy.lang.Closure code)
Creates a priority selector
After creation the selector needs to be started using the start() method.
|
Modifier and Type | Method and Description |
---|---|
void |
doSelect()
Ask for another select operation on the internal select instance.
|
allGuardsClosed, setGuard, setGuards
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 DataflowPrioritySelector(PGroup group, java.util.Map<java.lang.String,java.lang.Object> channels, groovy.lang.Closure code)
group
- A parallel group to use threads from in the internal actorchannels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputscode
- The selector's body to run each time all inputs have a value to readpublic void doSelect()
doSelect
in class DataflowSelector