Package com.batch.batch_flutter
Class Promise<T>
java.lang.Object
com.batch.batch_flutter.Promise<T>
A simple Promise-like implementation that is not thread-safe.
then() can't mutate the value.
Be careful: catch only works for an explicit rejection, NOT automatically for exceptions thrown in ThenRunnables
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
Executor that does not automatically resolve the promise once donestatic interface
Executor that automatically resolves the promise with the returned value once done, even if nullstatic enum
static interface
-
Constructor Summary
ConstructorDescriptionPromise()
Promise
(Promise.DeferredResultExecutorRunnable<T> executor) Promise
(Promise.ExecutorRunnable<T> executor) -
Method Summary
Modifier and TypeMethodDescriptioncatchException
(Promise.CatchRunnable catchRunnable) void
static <T> Promise<T>
void
static <T> Promise<T>
resolved
(T value) setExecutor
(Executor executor) Set the executor then/catch runnables should be posted onthen
(Promise.ThenRunnable<T> thenRunnable)
-
Constructor Details
-
Promise
public Promise() -
Promise
-
Promise
-
-
Method Details
-
resolved
-
rejected
-
resolve
-
reject
-
then
-
catchException
-
getStatus
-
setExecutor
Set the executor then/catch runnables should be posted on
-