org.codehaus.gpars

groovyx.gpars.dataflow
[Java] Class SyncDataflowQueue

java.lang.Object
  groovyx.gpars.dataflow.DataflowQueue
      groovyx.gpars.dataflow.SyncDataflowQueue

@SuppressWarnings({"ClassWithTooManyMethods"})
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.

Authors:
Vaclav Pech Date: Jun 5, 2009


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()

Creates a new variable to perform the next data exchange

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

SyncDataflowQueue()


 
Method Detail

chainWith

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


createVariable

@Override
protected DataflowVariable createVariable()
Creates a new variable to perform the next data exchange
Returns:
The newly created SyncDataflowVariable instance with exactly one expected reader


merge

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


tap

@Override
public DataflowReadChannel tap(PGroup group, DataflowWriteChannel target)


toString

@Override
public java.lang.String toString()


 

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