|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataflowReadChannel<T>
A common interface for all dataflow variables, streams or queues
Method Summary | |
---|---|
T |
getVal()
Reads the current value of the channel. |
T |
getVal(long timeout,
java.util.concurrent.TimeUnit units)
Reads the current value of the channel. |
void |
getValAsync(MessageStream callback)
Asynchronously retrieves the value from the channel. |
void |
getValAsync(java.lang.Object attachment,
MessageStream callback)
Asynchronously retrieves the value from the channel. |
boolean |
isBound()
Check if value has been set already for this expression |
DataflowExpression<T> |
poll()
Retrieves the value at the head of the buffer. |
void |
rightShift(groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data became available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled |
void |
whenBound(groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data becomes available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled. |
void |
whenBound(MessageStream stream)
Send the bound data to provided stream when it becomes available |
void |
whenBound(groovyx.gpars.group.PGroup group,
groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data becomes available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled. |
void |
whenBound(Pool pool,
groovy.lang.Closure closure)
Schedule closure to be executed by pooled actor after data becomes available It is important to notice that even if data already available the execution of closure will not happen immediately but will be scheduled. |
void |
wheneverBound(groovy.lang.Closure closure)
Send all pieces of data bound in the future to the provided stream when it becomes available * |
void |
wheneverBound(MessageStream stream)
Send all pieces of data bound in the future to the provided stream when it becomes available |
Method Detail |
---|
void getValAsync(MessageStream callback)
callback
- An actor to send the bound value to.void getValAsync(java.lang.Object attachment, MessageStream callback)
attachment
- arbitrary non-null attachment if reader needs better identification of resultcallback
- An actor to send the bound value plus the supplied index to.T getVal() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread gets interrupted while waiting for the channel to be boundT getVal(long timeout, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedException
timeout
- The timeout valueunits
- Units for the timeout
java.lang.InterruptedException
- If the current thread gets interrupted while waiting for the channel to be boundvoid rightShift(groovy.lang.Closure closure)
closure
- closure to execute when data availablevoid whenBound(groovy.lang.Closure closure)
closure
- closure to execute when data availablevoid whenBound(Pool pool, groovy.lang.Closure closure)
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data availablevoid whenBound(groovyx.gpars.group.PGroup group, groovy.lang.Closure closure)
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data availablevoid whenBound(MessageStream stream)
stream
- stream where to send resultvoid wheneverBound(groovy.lang.Closure closure)
closure
- closure to execute when data availablevoid wheneverBound(MessageStream stream)
stream
- stream where to send resultboolean isBound()
DataflowExpression<T> poll() throws java.lang.InterruptedException
java.lang.InterruptedException
- If the current thread is interrupted
|
Copyright © 2008–2010 Václav Pech. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |