Encapsulates the notion of a Promise, a Future-like interface designed to easy integration of asynchronous functions
Type Params | Return Type | Name and description |
---|---|---|
|
Promise<T> |
accept(T value) Assigns a value to an unfulfilled promise |
|
Promise<T> |
onComplete(groovy.lang.Closure callable) Execute the given closure when the promise completes |
|
Promise<T> |
onError(groovy.lang.Closure callable) Execute the given closure when an error occurs |
|
Promise<T> |
then(groovy.lang.Closure callable) Same as #onComplete |
Methods inherited from class | Name |
---|---|
interface java.util.concurrent.Future |
java.util.concurrent.Future#isCancelled(), java.util.concurrent.Future#isDone(), java.util.concurrent.Future#get(), java.util.concurrent.Future#get(long, java.util.concurrent.TimeUnit), java.util.concurrent.Future#cancel(boolean) |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Assigns a value to an unfulfilled promise
value
- The valueExecute the given closure when the promise completes
Execute the given closure when an error occurs
Same as #onComplete