ResultType - public interface Promise<ResultType>
extends delight.async.Operation<ResultType>
Type for variables which hold promises.
| Modifier and Type | Method and Description |
|---|---|
void |
addExceptionFallback(delight.functional.Closure<Throwable> closure)
Registeres a listener for exceptions, which is triggered when no
listeners have been defined using
catchExceptions(Closure) |
ResultType |
cachedResult()
If this promises has been resolved, the result obtained will be returned
by this function.
|
void |
catchExceptions(delight.functional.Closure<Throwable> closure)
Register a listener of exceptions.
|
ResultType |
get()
Attempts to resolve this promise synchronously.
|
void |
get(delight.functional.Closure<ResultType> closure)
Attempts to resolve this promise asynchronously.
|
ResultType get()
Attempts to resolve this promise synchronously.
void catchExceptions(delight.functional.Closure<Throwable> closure)
Register a listener of exceptions.
closure - Closure to be called if an exception occurs in resolving the
promise.void addExceptionFallback(delight.functional.Closure<Throwable> closure)
Registeres a listener for exceptions, which is triggered when no
listeners have been defined using catchExceptions(Closure)
closure - void get(delight.functional.Closure<ResultType> closure)
Attempts to resolve this promise asynchronously.
closure - ResultType cachedResult()
If this promises has been resolved, the result obtained will be returned by this function.
Otherwise, returns null.
Copyright © 2018. All rights reserved.