|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
groovyx.gpars.dataflow.Promisegroovyx.gpars.dataflow.SelectableChannel
public interface Promise extends SelectableChannel
A unifying future-like interface to dataflow variables, asynchronous functions and active objects. Represents the read end of DataflowVariables.
Method Summary | |
---|---|
java.lang.Object
|
get()
|
java.lang.Object
|
get(long timeout, java.util.concurrent.TimeUnit units)
|
java.lang.Throwable
|
getError()
|
boolean
|
isBound()
|
boolean
|
isError()
|
void
|
join()
// * Reads the current value of the channel. |
void
|
join(long timeout, java.util.concurrent.TimeUnit units)
Schedule closure to be executed after data became available. |
Promise
|
rightShift(groovy.lang.Closure closure)
|
Promise
|
then(groovy.lang.Closure closure)
|
Promise
|
then(Pool pool, groovy.lang.Closure closure)
Check if value has been set already for this expression |
Promise
|
then(PGroup group, groovy.lang.Closure closure)
|
Promise
|
then(groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
May be used by lazy implementations to warm up |
Promise
|
then(Pool pool, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
|
Promise
|
then(PGroup group, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
|
void
|
touch()
|
void
|
whenBound(groovy.lang.Closure closure)
|
void
|
whenBound(Pool pool, groovy.lang.Closure closure)
|
void
|
whenBound(PGroup group, groovy.lang.Closure closure)
|
void
|
whenBound(MessageStream stream)
|
Methods inherited from interface SelectableChannel | |
---|---|
poll, wheneverBound, wheneverBound |
Method Detail |
---|
* Asynchronously retrieves the value from the channel. Sends the actual value of the channel as a message // public java.lang.Object get()
* with a map holding the supplied attachment under the 'attachment' key and the actual value of the channel under // public java.lang.Object get(long timeout, java.util.concurrent.TimeUnit units)
public java.lang.Throwable getError()
public boolean isBound()
public boolean isError()
public void join()
public void join(long timeout, java.util.concurrent.TimeUnit units)
closure
- closure to execute when data becomes available. The closure should take at most one argument.
public Promise rightShift(groovy.lang.Closure closure)
public Promise then(groovy.lang.Closure closure)
public Promise then(Pool pool, groovy.lang.Closure closure)
public Promise then(PGroup group, groovy.lang.Closure closure)
public Promise then(groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
public Promise then(Pool pool, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
public Promise then(PGroup group, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
public void touch()
public void whenBound(groovy.lang.Closure closure)
public void whenBound(Pool pool, groovy.lang.Closure closure)
public void whenBound(PGroup group, groovy.lang.Closure closure)
public void whenBound(MessageStream stream)
Copyright © 2008–2013 Václav Pech. All Rights Reserved.