Encapsulates the notion of a Promise, a Future-like interface designed to easy integration of asynchronous functions
Type | Name and description |
---|---|
T |
get() Retrieves the result, blocking until the value is available |
T |
get(long timeout, java.util.concurrent.TimeUnit units) Retrieves the result, blocking until the value is available or the timeout is reached |
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 |
Retrieves the result, blocking until the value is available
Retrieves the result, blocking until the value is available or the timeout is reached
timeout
- The timeoutunits
- The timeout unitsExecute the given closure when the promise completes
Execute the given closure when an error occurs
Same as #onComplete