|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
groovyx.gpars.dataflow.SelectableChannel groovyx.gpars.dataflow.Promise
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)
|
Promise
|
then(PGroup group, groovy.lang.Closure closure)
|
Promise
|
then(groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
|
Promise
|
then(Pool pool, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
|
Promise
|
then(PGroup group, groovy.lang.Closure closure, groovy.lang.Closure errorHandler)
Checks if the promise is bound to an error |
Promise
|
thenForkAndJoin(groovy.lang.Closure... closures)
May be used by lazy implementations to warm up |
Promise
|
thenForkAndJoin(Pool pool, groovy.lang.Closure... closures)
|
Promise
|
thenForkAndJoin(PGroup group, groovy.lang.Closure... closures)
|
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 |
---|
@java.lang.SuppressWarnings* Asynchronously retrieves the value from the channel. Sends the actual value of the channel as a message // public java.lang.Object get()
@java.lang.SuppressWarnings* 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 Promise thenForkAndJoin(groovy.lang.Closure... closures)
public Promise thenForkAndJoin(Pool pool, groovy.lang.Closure... closures)
public Promise thenForkAndJoin(PGroup group, groovy.lang.Closure... closures)
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.