|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
@groovy.transform.CompileStatic interface Promise
Encapsulates the notion of a Promise, a Future-like interface designed to easy integration of asynchronous functions
Method Summary | |
---|---|
java.lang.Object
|
get()
Retrieves the result, blocking until the value is available |
java.lang.Object
|
get(long timeout, java.util.concurrent.TimeUnit units)
Retrieves the result, blocking until the value is available or the timeout is reached |
Promise
|
onComplete(groovy.lang.Closure callable)
Execute the given closure when the promise completes |
Promise
|
onError(groovy.lang.Closure callable)
Execute the given closure when an error occurs |
Promise
|
then(groovy.lang.Closure callable)
Same as #onComplete |
Method Detail |
---|
java.lang.Object get()
java.lang.Object get(long timeout, java.util.concurrent.TimeUnit units)
timeout
- The timeoutunits
- The timeout units
Promise onComplete(groovy.lang.Closure callable)
Promise onError(groovy.lang.Closure callable)
Promise then(groovy.lang.Closure callable)
Groovy Documentation