A unifying future-like interface to dataflow variables, asynchronous functions and active objects. Represents the read end of DataflowVariables.
Type | Name and description |
---|---|
T |
get() Retrieves the value of the variable, blocking until a value is available |
T |
get(long timeout, java.util.concurrent.TimeUnit units) Retrieves the value of the variable, blocking up to given timeout, if the value has not been assigned yet. |
java.lang.Throwable |
getError() Returns the error bound to the promise |
boolean |
isBound() Check if value has been set already for this expression |
boolean |
isError() Checks if the promise is bound to an error |
void |
join() // * Asynchronously retrieves the value from the channel. |
void |
join(long timeout, java.util.concurrent.TimeUnit units) Blocks, if the value has not been assigned yet to the DataflowVariable |
Promise<V> |
rightShift(groovy.lang.Closure<V> closure) Schedule closure to be executed after data became available. |
Promise<V> |
then(groovy.lang.Closure<V> closure) Schedule closure to be executed after data became available. |
Promise<V> |
then(Pool pool, groovy.lang.Closure<V> closure) Schedule closure to be executed after data becomes available. |
Promise<V> |
then(PGroup group, groovy.lang.Closure<V> closure) Schedule closure to be executed after data becomes available. |
Promise<V> |
then(groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler) Schedule closure to be executed after data became available. |
Promise<V> |
then(Pool pool, groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler) Schedule closure to be executed after data becomes available. |
Promise<V> |
then(PGroup group, groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler) Schedule closure to be executed after data becomes available. |
Promise<java.util.List> |
thenForkAndJoin(groovy.lang.Closure<? extends java.lang.Object>... closures) Schedule a set of closures to be executed after data became available on the current promise. |
Promise<java.util.List> |
thenForkAndJoin(Pool pool, groovy.lang.Closure<? extends java.lang.Object>... closures) Schedule a set of closures to be executed after data became available on the current promise. |
Promise<java.util.List> |
thenForkAndJoin(PGroup group, groovy.lang.Closure<? extends java.lang.Object>... closures) Schedule a set of closures to be executed after data became available on the current promise. |
void |
touch() May be used by lazy implementations to warm up |
void |
whenBound(groovy.lang.Closure<V> closure) Schedule closure to be executed after data becomes available. |
void |
whenBound(Pool pool, groovy.lang.Closure<V> closure) Schedule closure to be executed after data becomes available. |
void |
whenBound(PGroup group, groovy.lang.Closure<V> closure) Schedule closure to be executed after data becomes available. |
void |
whenBound(MessageStream stream) Send the bound data to provided stream when it becomes available |
Methods inherited from class | Name |
---|---|
interface SelectableChannel |
poll, wheneverBound, wheneverBound |
Retrieves the value of the variable, blocking until a value is available
Retrieves the value of the variable, blocking up to given timeout, if the value has not been assigned yet.
timeout
- The timeout valueunits
- Units for the timeoutReturns the error bound to the promise
Check if value has been set already for this expression
Checks if the promise is bound to an error
// * Asynchronously retrieves the value from the channel. Sends the actual value of the channel as a message // * back the the supplied actor once the value has been bound. // * The actor can perform other activities or release a thread back to the pool by calling react() waiting for the message // * with the value of the Dataflow channel. // * // *
callback
- An actor to send the bound value to.
//Blocks, if the value has not been assigned yet to the DataflowVariable
timeout
- The timeout valueunits
- Units for the timeoutSchedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled
closure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled
closure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data became available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled
closure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.Schedule a set of closures to be executed after data became available on the current promise. It is important to notice that even if the expression is already bound the execution of closures will not happen immediately, but will be scheduled. The returned Promise will hold a list of results of the individual closures, ordered in the same order. In case of an exception being thrown from any of the closures, the first exception gets propagated into the promise returned from the method.
closures
- closure to execute when data becomes available. The closure should take at most one argument.Schedule a set of closures to be executed after data became available on the current promise. It is important to notice that even if the expression is already bound the execution of closures will not happen immediately, but will be scheduled. The returned Promise will hold a list of results of the individual closures, ordered in the same order. In case of an exception being thrown from any of the closures, the first exception gets propagated into the promise returned from the method.
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosures
- closure to execute when data becomes available. The closure should take at most one argument.Schedule a set of closures to be executed after data became available on the current promise. It is important to notice that even if the expression is already bound the execution of closures will not happen immediately, but will be scheduled. The returned Promise will hold a list of results of the individual closures, ordered in the same order. In case of an exception being thrown from any of the closures, the first exception gets propagated into the promise returned from the method.
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosures
- closure to execute when data becomes available. The closure should take at most one argument.May be used by lazy implementations to warm up
Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
closure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.Schedule closure to be executed after data becomes available. It is important to notice that even if the expression is already bound the execution of closure will not happen immediately but will be scheduled.
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.Send the bound data to provided stream when it becomes available
stream
- stream where to send result