@AutoFinal @CompileStatic class AwaitablePromise<T> extends java.lang.Object implements Awaitable<T>, Promise<T>
A Grails Promise backed by a Groovy Awaitable.
The promise is itself an Awaitable, so it can be handed to Groovy's
await and to the Awaitable combinators such as Awaitable.all
without any conversion.
T - the promised value type| Constructor and description |
|---|
AwaitablePromise(PromiseFactory promiseFactory, Awaitable<T> awaitable) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
Promise<T> |
accept(T value)Binds the value of an unfulfilled promise. |
|
boolean |
cancel(boolean mayInterruptIfRunning) |
|
boolean |
cancel() |
|
Awaitable<T> |
exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T> function) |
|
T |
get() |
|
T |
get(long timeout, java.util.concurrent.TimeUnit units) |
|
boolean |
isCancelled() |
|
boolean |
isCompletedExceptionally() |
|
boolean |
isDone() |
|
Promise<T> |
leftShift(Closure<T> callable) |
|
Promise<T> |
onComplete(Closure<T> callable) |
|
Promise<T> |
onError(Closure<T> callable) |
|
Promise<T> |
then(Closure<T> callable) |
<U> |
Awaitable<U> |
then(java.util.function.Function<? super T, ? extends U> function) |
<U> |
Awaitable<U> |
thenCompose(java.util.function.Function<? super T, ? extends Awaitable<U>> function) |
|
java.util.concurrent.CompletableFuture<T> |
toCompletableFuture() |
|
java.lang.String |
toString() |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
The Groovy awaitable this promise delegates to
Binds the value of an unfulfilled promise. A promise created without work is a DataflowVariable, so binding it twice fails with java.lang.IllegalStateException. A promise that carries work completes with the given value if that work has not finished, in which case the work's own result is discarded, and ignores the value once it has.