A builder for operator pipelines. The greatest benefit of using the Pipeline class compared to chaining the channels directly is the ease with which a custom thread pool/group can be applied to all the operators along the constructed chain.
Modifiers | Name | Description |
---|---|---|
private boolean |
complete |
|
private PGroup |
group |
|
private DataflowReadChannel |
output |
Constructor and description |
---|
Pipeline
(DataflowReadChannel output) |
Pipeline
(Pool pool, DataflowReadChannel output) |
Pipeline
(PGroup group, DataflowReadChannel output) |
Type | Name and description |
---|---|
void |
binaryChoice(DataflowWriteChannel<T> trueBranch, DataflowWriteChannel<T> falseBranch, groovy.lang.Closure<java.lang.Boolean> code) Directs the output to one of the two output channels depending on the boolean result of the provided closure. |
void |
binaryChoice(java.util.Map<java.lang.String, java.lang.Object> params, DataflowWriteChannel<T> trueBranch, DataflowWriteChannel<T> falseBranch, groovy.lang.Closure<java.lang.Boolean> code) Directs the output to one of the two output channels depending on the boolean result of the provided closure. |
Pipeline |
chainWith(groovy.lang.Closure<V> closure) Creates and attaches a new operator |
Pipeline |
chainWith(java.util.Map<java.lang.String, java.lang.Object> params, groovy.lang.Closure<V> closure) Creates and attaches a new operator |
private void |
checkState() |
void |
choice(java.util.List<DataflowWriteChannel<T>> outputs, groovy.lang.Closure<java.lang.Integer> code) Directs the output to one of the output channels depending on the int result of the provided closure. |
void |
choice(java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<DataflowWriteChannel<T>> outputs, groovy.lang.Closure<java.lang.Integer> code) Directs the output to one of the output channels depending on the int result of the provided closure. |
Pipeline |
filter(groovy.lang.Closure<java.lang.Boolean> closure) Creates and attaches a new operator that will filter data using the provided closure |
Pipeline |
filter(java.util.Map<java.lang.String, java.lang.Object> params, groovy.lang.Closure<java.lang.Boolean> closure) Creates and attaches a new operator that will filter data using the provided closure |
PGroup |
getGroup() |
DataflowReadChannel |
getOutput() |
void |
into(DataflowWriteChannel<V> target) Makes the output of the pipeline to be an input for the specified channel |
void |
into(java.util.Map<java.lang.String, java.lang.Object> params, DataflowWriteChannel<V> target) Makes the output of the pipeline to be an input for the specified channel |
boolean |
isComplete() |
Pipeline |
merge(DataflowReadChannel<java.lang.Object> other, groovy.lang.Closure closure) Merges channels together as inputs for a single dataflow operator. |
Pipeline |
merge(java.util.List<DataflowReadChannel<java.lang.Object>> others, groovy.lang.Closure closure) Merges channels together as inputs for a single dataflow operator. |
Pipeline |
merge(java.util.Map<java.lang.String, java.lang.Object> params, DataflowReadChannel<java.lang.Object> other, groovy.lang.Closure closure) Merges channels together as inputs for a single dataflow operator. |
Pipeline |
merge(java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<DataflowReadChannel<java.lang.Object>> others, groovy.lang.Closure closure) Merges channels together as inputs for a single dataflow operator. |
Pipeline |
or(groovy.lang.Closure<V> closure) Creates and attaches a new operator |
void |
or(DataflowWriteChannel<V> target) Makes the output of the pipeline to be an input for the specified channel |
void |
separate(java.util.List<DataflowWriteChannel<?>> outputs, groovy.lang.Closure<java.util.List<java.lang.Object>> code) Allows the closure to output different values to different output channels. |
void |
separate(java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<DataflowWriteChannel<?>> outputs, groovy.lang.Closure<java.util.List<java.lang.Object>> code) Allows the closure to output different values to different output channels. |
void |
split(DataflowWriteChannel<V> target1, DataflowWriteChannel<V> target2) Splits the output of the pipeline to be an input for the specified channels |
void |
split(java.util.List<DataflowWriteChannel<V>> targets) Makes the output of the pipeline to be an input for the specified channels |
void |
split(java.util.Map<java.lang.String, java.lang.Object> params, DataflowWriteChannel<V> target1, DataflowWriteChannel<V> target2) Splits the output of the pipeline to be an input for the specified channels |
void |
split(java.util.Map<java.lang.String, java.lang.Object> params, java.util.List<DataflowWriteChannel<V>> targets) Makes the output of the pipeline to be an input for the specified channels |
Pipeline |
tap(DataflowWriteChannel<V> target) Taps into the pipeline at the current position, sending all data that pass through the pipeline also to the channel specified. |
Pipeline |
tap(java.util.Map<java.lang.String, java.lang.Object> params, DataflowWriteChannel<V> target) Taps into the pipeline at the current position, sending all data that pass through the pipeline also to the channel specified. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
trueBranch
- The channel to send data to if the closure returns truefalseBranch
- The channel to send data to if the closure returns truecode
- A closure directing data to either the true or the false output branchDirects the output to one of the two output channels depending on the boolean result of the provided closure.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)trueBranch
- The channel to send data to if the closure returns truefalseBranch
- The channel to send data to if the closure returns truecode
- A closure directing data to either the true or the false output branchCreates and attaches a new operator
closure
- The function to invoke on all incoming values as part of the new operator's body
- The type of values returned from the supplied closureCreates and attaches a new operator
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)closure
- The function to invoke on all incoming values as part of the new operator's body
- The type of values returned from the supplied closureDirects the output to one of the output channels depending on the int result of the provided closure.
outputs
- The channels to send data to.code
- A closure returning an index of the output channel to direct the data toDirects the output to one of the output channels depending on the int result of the provided closure.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)outputs
- The channels to send data to.code
- A closure returning an index of the output channel to direct the data toCreates and attaches a new operator that will filter data using the provided closure
closure
- The filter function to invoke on all incoming values to decide whether to pass the value on or notCreates and attaches a new operator that will filter data using the provided closure
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)closure
- The filter function to invoke on all incoming values to decide whether to pass the value on or notMakes the output of the pipeline to be an input for the specified channel
target
- The channel to copy data into
- The type of values passed between the channelsMakes the output of the pipeline to be an input for the specified channel
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)target
- The channel to copy data into
- The type of values passed between the channelsMerges channels together as inputs for a single dataflow operator.
other
- The channel to merge withclosure
- The function to invoke on all incoming values as part of the new operator's body. The number of arguments to the closure must match the number of input channels.Merges channels together as inputs for a single dataflow operator.
others
- The channels to merge withclosure
- The function to invoke on all incoming values as part of the new operator's body. The number of arguments to the closure must match the number of input channels.Merges channels together as inputs for a single dataflow operator.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)other
- The channel to merge withclosure
- The function to invoke on all incoming values as part of the new operator's body. The number of arguments to the closure must match the number of input channels.Merges channels together as inputs for a single dataflow operator.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)others
- The channels to merge withclosure
- The function to invoke on all incoming values as part of the new operator's body. The number of arguments to the closure must match the number of input channels.Creates and attaches a new operator
closure
- The function to invoke on all incoming values as part of the new operator's body
- The type of values returned from the supplied closureMakes the output of the pipeline to be an input for the specified channel
target
- The channel to copy data into
- The type of values passed between the channelsAllows the closure to output different values to different output channels.
outputs
- The channels to send data to.code
- A closure returning a list of values to pass to the output channels. Values are output to the output channels with identical index.Allows the closure to output different values to different output channels.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)outputs
- The channels to send data to.code
- A closure returning a list of values to pass to the output channels. Values are output to the output channels with identical index.Splits the output of the pipeline to be an input for the specified channels
target1
- The first channel to copy data intotarget2
- The second channel to copy data into
- The type of values passed between the channelsMakes the output of the pipeline to be an input for the specified channels
targets
- The channels to copy data into
- The type of values passed between the channelsSplits the output of the pipeline to be an input for the specified channels
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)target1
- The first channel to copy data intotarget2
- The second channel to copy data into
- The type of values passed between the channelsMakes the output of the pipeline to be an input for the specified channels
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)targets
- The channels to copy data into
- The type of values passed between the channelsTaps into the pipeline at the current position, sending all data that pass through the pipeline also to the channel specified.
target
- The channel to tap data into
- The type of values passed between the channelsTaps into the pipeline at the current position, sending all data that pass through the pipeline also to the channel specified.
params
- Additional parameters to initialize the operator with (e.g. listeners or maxForks)target
- The channel to tap data into
- The type of values passed between the channelsCopyright © 2008–2014 Václav Pech. All Rights Reserved.