groovyx.gpars.dataflow
[Java] Class DataCallback
java.lang.Object
groovyx.gpars.serial.WithSerialId
groovyx.gpars.actor.impl.MessageStream
groovyx.gpars.dataflow.DataCallback
public final class DataCallback
extends MessageStream
A helper class enabling the 'whenBound()' or 'getValAsync' functionality of a DataflowVariable and DataflowQueue,
as well as 'sendAndContinue()' on actors.
A task that waits asynchronously on the DFV to be bound. Once the DFV is bound,
upon receiving the message the actor runs the supplied closure / code with the DFV value as a parameter.
- Authors:
- Vaclav Pech, Alex Tkachman
Date: Sep 13, 2009
Constructor Summary |
DataCallback(groovy.lang.Closure code, PGroup pGroup)
@param code The closure to run
|
Method Summary |
MessageStream
|
send(java.lang.Object message)
Sends a message back to the DataCallback.
|
Methods inherited from class java.lang.Object
|
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
code
private final groovy.lang.Closure code
-
parallelGroup
private final PGroup parallelGroup
-
serialVersionUID
private static final long serialVersionUID
-
DataCallback
public DataCallback(groovy.lang.Closure code, PGroup pGroup)
-
- Parameters:
code
- The closure to runpGroup
- pGroup The parallel group to join
send
@Override
public MessageStream send(java.lang.Object message)
- Sends a message back to the DataCallback.
Will schedule processing the internal closure with the thread pool
Registers its parallel group with DataflowExpressions for nested 'whenBound' handlers to use the same group.
Copyright © 2008–2010 Václav Pech. All Rights Reserved.