|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface Promise
A unifying future-like interface to dataflow variables, asynchronous functions and active objects.
Method Summary | |
---|---|
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. |
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 |
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(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
|
whenBound(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(MessageStream stream)
Send the bound data to provided stream when it becomes available |
Method Detail |
---|
@SuppressWarnings({"ProhibitedExceptionDeclared"}) public T get()
@SuppressWarnings({"ProhibitedExceptionDeclared"}) public T get(long timeout, java.util.concurrent.TimeUnit units)
timeout
- The timeout valueunits
- Units for the timeout
public T getVal()
public T getVal(long timeout, java.util.concurrent.TimeUnit units)
timeout
- The timeout valueunits
- Units for the timeout
public void getValAsync(MessageStream callback)
callback
- An actor to send the bound value to.
public 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.
public boolean isBound()
public void rightShift(groovy.lang.Closure closure)
closure
- closure to execute when data available
public void whenBound(groovy.lang.Closure closure)
closure
- closure to execute when data available
public void 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 available
public void whenBound(PGroup group, groovy.lang.Closure closure)
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data available
public void whenBound(MessageStream stream)
stream
- stream where to send result
Copyright © 2008–2010 Václav Pech. All Rights Reserved.