org.codehaus.gpars

groovyx.gpars.dataflow
[Java] Interface DataflowReadChannel


public interface DataflowReadChannel

A common interface for all dataflow variables, streams or queues

Authors:
Vaclav Pech Date: 21st Sep 2010


Method Summary
void binaryChoice(DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

Directs the output to one of the two output channels depending on the boolean result of the provided closure.

void binaryChoice(Pool pool, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

Directs the output to one of the two output channels depending on the boolean result of the provided closure.

void binaryChoice(PGroup group, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure 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 params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

Directs the output to one of the two output channels depending on the boolean result of the provided closure.

void binaryChoice(Pool pool, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

Directs the output to one of the two output channels depending on the boolean result of the provided closure.

void binaryChoice(PGroup group, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)

Directs the output to one of the two output channels depending on the boolean result of the provided closure.

DataflowReadChannel chainWith(groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

DataflowReadChannel chainWith(Pool pool, groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

DataflowReadChannel chainWith(PGroup group, groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

DataflowReadChannel chainWith(java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

DataflowReadChannel chainWith(Pool pool, java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

DataflowReadChannel chainWith(PGroup group, java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

void choice(java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

void choice(Pool pool, java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

void choice(PGroup group, java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

void choice(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

void choice(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

void choice(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Directs the output to one of the output channels depending on the int result of the provided closure.

DataflowReadChannel filter(groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowReadChannel filter(Pool pool, groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowReadChannel filter(PGroup group, groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowReadChannel filter(java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowReadChannel filter(Pool pool, java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowReadChannel filter(PGroup group, java.util.Map params, groovy.lang.Closure closure)

Creates and attaches a new operator that will filter data using the provided closure

DataflowChannelEventListenerManager getEventManager()

Retrieves the event manager object of this channel

java.lang.Object getVal()

Reads the current value of the channel.

java.lang.Object getVal(long timeout, java.util.concurrent.TimeUnit units)

Reads the current value of the channel.

void getValAsync(MessageStream callback)

Asynchronously retrieves the value from the channel.

void getValAsync(java.lang.Object attachment, MessageStream callback)

Asynchronously retrieves the value from the channel.

void into(DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

void into(Pool pool, DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

void into(PGroup group, DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

void into(java.util.Map params, DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

void into(Pool pool, java.util.Map params, DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

void into(PGroup group, java.util.Map params, DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

boolean isBound()

Check if value has been set already for this expression

int length()

Reports the current number of elements in the channel

DataflowReadChannel merge(DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(Pool pool, DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(PGroup group, DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(Pool pool, java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(PGroup group, java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(Pool pool, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(PGroup group, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(java.util.Map params, java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(Pool pool, java.util.Map params, java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel merge(PGroup group, java.util.Map params, java.util.List others, groovy.lang.Closure closure)

Merges channels together as inputs for a single dataflow operator.

DataflowReadChannel or(groovy.lang.Closure closure)

Creates and attaches a new operator processing values from the channel

void or(DataflowWriteChannel target)

Makes the output of the current channel to be an input for the specified channel

DataflowExpression poll()

Retrieves the value at the head of the buffer.

Promise rightShift(groovy.lang.Closure closure)

Schedule closure to be executed after data became available.

void separate(java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void separate(Pool pool, java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void separate(PGroup group, java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void separate(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void separate(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void separate(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)

Allows the closure to output different values to different output channels.

void split(DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(Pool pool, DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(PGroup group, DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

void split(Pool pool, java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

void split(PGroup group, java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

void split(java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(Pool pool, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(PGroup group, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)

Splits the output of the current channel to be an input for the specified channels

void split(java.util.Map params, java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

void split(Pool pool, java.util.Map params, java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

void split(PGroup group, java.util.Map params, java.util.List targets)

Makes the output of the current channel to be an input for the specified channels

DataflowReadChannel tap(DataflowWriteChannel target)

Taps into the pipeline.

DataflowReadChannel tap(Pool pool, DataflowWriteChannel target)

Taps into the pipeline.

DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)

Taps into the pipeline.

DataflowReadChannel tap(java.util.Map params, DataflowWriteChannel target)

Taps into the pipeline.

DataflowReadChannel tap(Pool pool, java.util.Map params, DataflowWriteChannel target)

Taps into the pipeline.

DataflowReadChannel tap(PGroup group, java.util.Map params, DataflowWriteChannel target)

Taps into the pipeline.

Promise then(groovy.lang.Closure closure)

Schedule closure to be executed after data became available.

Promise then(Pool pool, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

Promise then(PGroup group, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

void whenBound(groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

void whenBound(Pool pool, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

void whenBound(PGroup group, groovy.lang.Closure closure)

Schedule closure to be executed after data becomes available.

void whenBound(MessageStream stream)

Send the bound data to provided stream when it becomes available

void wheneverBound(groovy.lang.Closure closure)

Send all pieces of data bound in the future to the provided stream when it becomes available

void wheneverBound(MessageStream stream)

Send all pieces of data bound in the future to the provided stream when it becomes available.

 

Method Detail

binaryChoice

public void binaryChoice(DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


binaryChoice

public void binaryChoice(Pool pool, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
pool - The thread pool to use
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


binaryChoice

public void binaryChoice(PGroup group, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
group - The PGroup to use
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


binaryChoice

public void binaryChoice(java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


binaryChoice

public void binaryChoice(Pool pool, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


binaryChoice

public void binaryChoice(PGroup group, java.util.Map params, DataflowWriteChannel trueBranch, DataflowWriteChannel falseBranch, groovy.lang.Closure code)
Directs the output to one of the two output channels depending on the boolean result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
trueBranch - The channel to send data to if the closure returns true
falseBranch - The channel to send data to if the closure returns true
code - A closure directing data to either the true or the false output branch


chainWith

public DataflowReadChannel chainWith(groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


chainWith

public DataflowReadChannel chainWith(Pool pool, groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
pool - The thread pool to use
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


chainWith

public DataflowReadChannel chainWith(PGroup group, groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
group - The PGroup to use
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


chainWith

public DataflowReadChannel chainWith(java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


chainWith

public DataflowReadChannel chainWith(Pool pool, java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


chainWith

public DataflowReadChannel chainWith(PGroup group, java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


choice

public void choice(java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
outputs - The channels to send data to of the closure returns true
code - A closure returning an index of the output channel to direct the data to


choice

public void choice(Pool pool, java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
pool - The thread pool to use
outputs - The channels to send data to.
code - A closure returning an index of the output channel to direct the data to


choice

public void choice(PGroup group, java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
group - The PGroup to use
outputs - The channels to send data to.
code - A closure returning an index of the output channel to direct the data to


choice

public void choice(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
outputs - The channels to send data to of the closure returns true
code - A closure returning an index of the output channel to direct the data to


choice

public void choice(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
outputs - The channels to send data to.
code - A closure returning an index of the output channel to direct the data to


choice

public void choice(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Directs the output to one of the output channels depending on the int result of the provided closure.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
outputs - The channels to send data to.
code - A closure returning an index of the output channel to direct the data to


filter

public DataflowReadChannel filter(groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
closure - The filter function to invoke on all incoming values to decide whether to pass the value on or not
Returns:
A channel of the same type as this channel, which the new operator will output into.


filter

public DataflowReadChannel filter(Pool pool, groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
pool - The thread pool to use
closure - The filter function to invoke on all incoming values to decide whether to pass the value on or not
Returns:
A channel of the same type as this channel, which the new operator will output into.


filter

public DataflowReadChannel filter(PGroup group, groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
group - The PGroup to use
closure - The filter function to invoke on all incoming values to decide whether to pass the value on or not
Returns:
A channel of the same type as this channel, which the new operator will output into.


filter

public DataflowReadChannel filter(java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
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 not
Returns:
A channel of the same type as this channel, which the new operator will output into.


filter

public DataflowReadChannel filter(Pool pool, java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
closure - The filter function to invoke on all incoming values to decide whether to pass the value on or not
Returns:
A channel of the same type as this channel, which the new operator will output into.


filter

public DataflowReadChannel filter(PGroup group, java.util.Map params, groovy.lang.Closure closure)
Creates and attaches a new operator that will filter data using the provided closure
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
closure - The filter function to invoke on all incoming values to decide whether to pass the value on or not
Returns:
A channel of the same type as this channel, which the new operator will output into.


getEventManager

public DataflowChannelEventListenerManager getEventManager()
Retrieves the event manager object of this channel
Returns:
The event manager to register custom events listeners


getVal

public java.lang.Object getVal()
Reads the current value of the channel. Blocks, if the value has not been assigned yet.
throws:
InterruptedException If the current thread gets interrupted while waiting for the channel to be bound
Returns:
The actual value


getVal

public java.lang.Object getVal(long timeout, java.util.concurrent.TimeUnit units)
Reads the current value of the channel. Blocks up to given timeout, if the value has not been assigned yet.
throws:
InterruptedException If the current thread gets interrupted while waiting for the channel to be bound
Parameters:
timeout - The timeout value
units - Units for the timeout
Returns:
The actual value


getValAsync

public void getValAsync(MessageStream callback)
Asynchronously retrieves the value from the channel. Sends the actual value of the channel as a message back the the supplied actor once the value has been bound. The actor can perform other activities or release a thread back to the pool by calling react() waiting for the message with the value of the Dataflow channel.
Parameters:
callback - An actor to send the bound value to.


getValAsync

public void getValAsync(java.lang.Object attachment, MessageStream callback)
Asynchronously retrieves the value from the channel. Sends a message back the the supplied MessageStream with a map holding the supplied attachment under the 'attachment' key and the actual value of the channel under the 'result' key once the value has been bound. Attachment is an arbitrary value helping the actor.operator match its request with the reply. The actor/operator can perform other activities or release a thread back to the pool by calling react() waiting for the message with the value of the Dataflow channel.
Parameters:
attachment - arbitrary non-null attachment if reader needs better identification of result
callback - An actor to send the bound value plus the supplied index to.


into

public void into(DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
target - The channel to copy data into


into

public void into(Pool pool, DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
pool - The thread pool to use
target - The channel to copy data into


into

public void into(PGroup group, DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
group - The PGroup to use
target - The channel to copy data into


into

public void into(java.util.Map params, DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
target - The channel to copy data into


into

public void into(Pool pool, java.util.Map params, DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
target - The channel to copy data into


into

public void into(PGroup group, java.util.Map params, DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
target - The channel to copy data into


isBound

public boolean isBound()
Check if value has been set already for this expression
Returns:
true if bound already


length

public int length()
Reports the current number of elements in the channel
Returns:
The current snapshot of the number of elements in the channel


merge

public DataflowReadChannel merge(DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
other - The channel to merge with
- The type of values passed between the channels
closure - 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.
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(Pool pool, DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
pool - The thread pool to use
other - The channel to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(PGroup group, DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
group - The PGroup to use
other - The channel to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(Pool pool, java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
pool - The thread pool to use
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(PGroup group, java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
group - The PGroup to use
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
other - The channel to merge with
- The type of values passed between the channels
closure - 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.
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(Pool pool, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
other - The channel to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(PGroup group, java.util.Map params, DataflowReadChannel other, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
other - The channel to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(java.util.Map params, java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(Pool pool, java.util.Map params, java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


merge

public DataflowReadChannel merge(PGroup group, java.util.Map params, java.util.List others, groovy.lang.Closure closure)
Merges channels together as inputs for a single dataflow operator.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
others - The channels to merge with
closure - 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.
- The type of values passed between the channels
Returns:
A channel of the same type as this channel, which the new operator will output into.


or

public DataflowReadChannel or(groovy.lang.Closure closure)
Creates and attaches a new operator processing values from the channel
Parameters:
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 closure
Returns:
A channel of the same type as this channel, which the new operator will output into.


or

public void or(DataflowWriteChannel target)
Makes the output of the current channel to be an input for the specified channel
Parameters:
target - The channel to copy data into


poll

@SuppressWarnings({"ClassReferencesSubclass"})
public DataflowExpression poll()
Retrieves the value at the head of the buffer. Returns null, if no value is available.
throws:
InterruptedException If the current thread is interrupted
Returns:
The value bound to the DFV at the head of the stream or null


rightShift

public Promise rightShift(groovy.lang.Closure closure)
Schedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled

rightShift() redefines the >> operator so you can write df >> {println it} instead of df.whenBound{println it}

Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


separate

public void separate(java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
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.


separate

public void separate(Pool pool, java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
pool - The thread pool to use
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.


separate

public void separate(PGroup group, java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
group - The PGroup to use
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.


separate

public void separate(java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
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.


separate

public void separate(Pool pool, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
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.


separate

public void separate(PGroup group, java.util.Map params, java.util.List outputs, groovy.lang.Closure code)
Allows the closure to output different values to different output channels.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
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.


split

public void split(DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(Pool pool, DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
pool - The thread pool to use
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(PGroup group, DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
group - The PGroup to use
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
targets - The channels to copy data into


split

public void split(Pool pool, java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
pool - The thread pool to use
targets - The channels to copy data into


split

public void split(PGroup group, java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
group - The PGroup to use
targets - The channels to copy data into


split

public void split(java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(Pool pool, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(PGroup group, java.util.Map params, DataflowWriteChannel target1, DataflowWriteChannel target2)
Splits the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
target1 - The first channel to copy data into
target2 - The second channel to copy data into


split

public void split(java.util.Map params, java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
targets - The channels to copy data into


split

public void split(Pool pool, java.util.Map params, java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
targets - The channels to copy data into


split

public void split(PGroup group, java.util.Map params, java.util.List targets)
Makes the output of the current channel to be an input for the specified channels
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
targets - The channels to copy data into


tap

public DataflowReadChannel tap(DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


tap

public DataflowReadChannel tap(Pool pool, DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
pool - The thread pool to use
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


tap

public DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
group - The PGroup to use
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


tap

public DataflowReadChannel tap(java.util.Map params, DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


tap

public DataflowReadChannel tap(Pool pool, java.util.Map params, DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
pool - The thread pool to use
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


tap

public DataflowReadChannel tap(PGroup group, java.util.Map params, DataflowWriteChannel target)
Taps into the pipeline. The supplied channel will receive a copy of all messages passed through.
Parameters:
params - Additional parameters to initialize the operator with (e.g. listeners or maxForks)
group - The PGroup to use
target - The channel to tap data into
Returns:
A channel of the same type as this channel, which the new operator will output into.


then

public Promise then(groovy.lang.Closure closure)
Schedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled
Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


then

public Promise then(Pool pool, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
pool - The thread pool to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


then

public Promise then(PGroup group, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
group - The PGroup to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.
Returns:
A promise for the results of the supplied closure. This allows for chaining of then() method calls.


whenBound

public void whenBound(groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.


whenBound

public void whenBound(Pool pool, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
pool - The thread pool to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.


whenBound

public void whenBound(PGroup group, groovy.lang.Closure closure)
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
Parameters:
group - The PGroup to use for task scheduling for asynchronous message delivery
closure - closure to execute when data becomes available. The closure should take at most one argument.


whenBound

public void whenBound(MessageStream stream)
Send the bound data to provided stream when it becomes available
Parameters:
stream - stream where to send result


wheneverBound

public void wheneverBound(groovy.lang.Closure closure)
Send all pieces of data bound in the future to the provided stream when it becomes available. *
Parameters:
closure - closure to execute when data becomes available. The closure should take at most one argument.


wheneverBound

public void wheneverBound(MessageStream stream)
Send all pieces of data bound in the future to the provided stream when it becomes available.
Parameters:
stream - stream where to send result


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.