interface Promise<T> extends java.util.concurrent.Future<T>
Encapsulates the notion of a Promise, a Future-like interface designed to easy integration of asynchronous functions
Type Params | Return Type | Name and description |
---|---|---|
|
abstract Promise<T> |
accept(T value) Assigns a value to an unfulfilled promise |
|
abstract Promise<T> |
onComplete(groovy.lang.Closure<T> callable) Execute the given closure when the promise completes |
|
abstract Promise<T> |
onError(groovy.lang.Closure<T> callable) Execute the given closure when an error occurs |
|
abstract Promise<T> |
then(groovy.lang.Closure<T> callable) Same as #onComplete |
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