public class DataflowSelector extends DataflowProcessor
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.lang.Boolean> |
guards |
protected Select |
select |
actor, INPUTS, MAX_FORKS, OUTPUTS, STATE_OBJECT, stateObject
Constructor and Description |
---|
DataflowSelector(PGroup group,
java.util.Map channels,
groovy.lang.Closure code)
Creates a selector
After creation the selector needs to be started using the start() method.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
countInputChannels(java.util.Map channels) |
protected void |
doSelect()
Ask for another select operation on the internal select instance.
|
void |
setGuard(int index,
boolean flag)
Used to enable/disable individual input channels from next selections
|
void |
setGuards(java.util.List<java.lang.Boolean> flags)
Used to enable/disable individual input channels from next selections
|
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, removeDataflowEventListener, reportError, shouldBeMultiThreaded, start, start, terminate, terminateAfterNextRun
protected final Select select
protected final java.util.List<java.lang.Boolean> guards
public DataflowSelector(PGroup group, java.util.Map 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 readprivate static boolean verifyChannelParameters(java.util.Map channels, int parameters)
private static java.lang.String countInputChannels(java.util.Map channels)
public final void setGuard(int index, boolean flag)
index
- The index of the channel to enable/disableflag
- True, if the channel should be included in selection, false otherwisepublic final void setGuards(java.util.List<java.lang.Boolean> flags)
flags
- The flags to apply to channelsprotected void doSelect()