|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.dataflow.DataflowQueue groovyx.gpars.dataflow.SyncDataflowQueue
@java.lang.SuppressWarningsfinal SyncDataflowQueueresult = new SyncDataflowQueue (); public final class SyncDataflowQueue extends DataflowQueue
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.
Field Summary |
---|
Fields inherited from class DataflowQueue | |
---|---|
eventManager, queue, queueLock, requests, wheneverBoundListeners |
Constructor Summary | |
SyncDataflowQueue()
|
Method Summary | |
---|---|
DataflowReadChannel
|
chainWith(PGroup group, groovy.lang.Closure closure)
|
protected DataflowVariable
|
createVariable()
|
DataflowReadChannel
|
merge(PGroup group, java.util.List others, groovy.lang.Closure closure)
|
DataflowReadChannel
|
tap(PGroup group, DataflowWriteChannel target)
|
java.lang.String
|
toString()
|
Methods inherited from class DataflowQueue | |
---|---|
binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, bind, chainWith, chainWith, chainWith, chainWith, chainWith, chainWith, choice, choice, choice, choice, choice, choice, copyDFV, createVariable, filter, filter, filter, filter, filter, filter, fireOnMessage, getEventManager, getQueue, getVal, getVal, getValAsync, getValAsync, hookWheneverBoundListeners, into, into, into, into, into, into, isBound, iterator, leftShift, leftShift, length, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, or, or, poll, retrieveForBind, retrieveOrCreateVariable, rightShift, separate, separate, separate, separate, separate, separate, split, split, split, split, split, split, split, split, split, split, split, split, tap, tap, tap, tap, tap, tap, then, then, then, toString, whenBound, whenBound, whenBound, whenBound, wheneverBound, wheneverBound |
Constructor Detail |
---|
SyncDataflowQueue()
Method Detail |
---|
@java.lang.OverridepublicDataflowReadChannel merge(final PGroup group, final List > others, final Closure closure) { public DataflowReadChannel chainWith(PGroup group, groovy.lang.Closure closure)
@java.lang.Overridegroup.operator(asList(this), asList(result, target), new ChainWithClosure(new CopyChannelsClosure())); protected DataflowVariable createVariable()
@java.lang.Override public DataflowReadChannel merge(PGroup group, java.util.List others, groovy.lang.Closure closure)
@java.lang.Override} public DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)
@java.lang.Override public java.lang.String toString()
Copyright © 2008–2013 Václav Pech. All Rights Reserved.