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.
Fields inherited from class | Fields |
---|---|
class DataflowQueue |
eventManager, queue, queueLock, requests, wheneverBoundListeners |
class WithSerialId |
serialHandle, serialVersionUID |
Constructor and description |
---|
SyncDataflowQueue
() |
Type | Name and description |
---|---|
DataflowReadChannel<V> |
chainWith(PGroup group, groovy.lang.Closure<V> closure) |
protected DataflowVariable<T> |
createVariable() Creates a new variable to perform the next data exchange |
DataflowReadChannel<V> |
merge(PGroup group, java.util.List<DataflowReadChannel<java.lang.Object>> others, groovy.lang.Closure<V> closure) |
DataflowReadChannel<T> |
tap(PGroup group, DataflowWriteChannel<T> target) |
java.lang.String |
toString() |
Creates a new variable to perform the next data exchange
Copyright © 2008–2014 Václav Pech. All Rights Reserved.