|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.dataflow.DataflowQueue<T> groovyx.gpars.dataflow.SyncDataflowQueue<T>
public final class SyncDataflowQueue<T>
Represents a thread-safe synchronous data flow stream. Values or DataflowVariables are added using the '<<' operator and safely read once available using the 'val' property. The iterative methods like each(), collect(), iterator(), any(), all() or the for loops work with snapshots of the stream at the time of calling the particular method. For actors and Dataflow Operators the asynchronous non-blocking variants of the getValAsync() methods can be used. They register the request to read a value and will send a message to the actor or operator once the value is available.
Unlike DataflowQueue, which exchanges data asynchronously, SyncDataflowQueue blocks the writer until a reader is ready to consume the message.
Constructor Summary | |
---|---|
SyncDataflowQueue()
|
Method Summary | ||
---|---|---|
protected DataflowVariable<T> |
createVariable()
Creates a new variable to perform the next data exchange |
|
|
chainWith(PGroup group,
groovy.lang.Closure<V> closure)
Creates and attaches a new operator processing values from the channel |
|
|
merge(PGroup group,
java.util.List<DataflowReadChannel<java.lang.Object>> others,
groovy.lang.Closure<V> closure)
Merges channels together as inputs for a single dataflow operator. |
|
DataflowReadChannel<T> |
tap(PGroup group,
DataflowWriteChannel<T> target)
Taps into the pipeline. |
|
java.lang.String |
toString()
|
Methods inherited from class groovyx.gpars.dataflow.DataflowQueue |
---|
binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, bind, filter, filter, filter, filter, filter, filter, getEventManager, getQueue, getVal, getVal, getValAsync, getValAsync, chainWith, chainWith, chainWith, chainWith, chainWith, choice, choice, choice, choice, choice, choice, into, into, into, into, into, into, isBound, iterator, leftShift, leftShift, length, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, or, or, poll, rightShift, separate, separate, separate, separate, separate, separate, split, split, split, split, split, split, split, split, split, split, split, split, tap, tap, tap, tap, tap, then, then, then, whenBound, whenBound, whenBound, whenBound, wheneverBound, wheneverBound |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SyncDataflowQueue()
Method Detail |
---|
protected DataflowVariable<T> createVariable()
createVariable
in class DataflowQueue<T>
public <V> DataflowReadChannel<V> chainWith(PGroup group, groovy.lang.Closure<V> closure)
DataflowReadChannel
chainWith
in interface DataflowReadChannel<T>
chainWith
in class DataflowQueue<T>
V
- The type of values returned from the supplied closuregroup
- The PGroup to useclosure
- The function to invoke on all incoming values as part of the new operator's body
public DataflowReadChannel<T> tap(PGroup group, DataflowWriteChannel<T> target)
DataflowReadChannel
tap
in interface DataflowReadChannel<T>
tap
in class DataflowQueue<T>
group
- The PGroup to usetarget
- The channel to tap data into
public <V> DataflowReadChannel<V> merge(PGroup group, java.util.List<DataflowReadChannel<java.lang.Object>> others, groovy.lang.Closure<V> closure)
DataflowReadChannel
merge
in interface DataflowReadChannel<T>
merge
in class DataflowQueue<T>
V
- The type of values passed between the channelsgroup
- The PGroup to useothers
- 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.
public java.lang.String toString()
toString
in class DataflowQueue<T>
|
Copyright © 2008–2012 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |