T - result typeS - status typeE - error typepublic class Deferred<T,S,E extends java.lang.Throwable>
extends java.lang.Object
| Constructor and Description |
|---|
Deferred(java.lang.Class<E> errorClass)
Constructs a basic deferred.
|
Deferred(java.lang.Class<E> errorClass,
Consumer<java.lang.Runnable> runner)
Constructs a deferred with a specified runner.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cached(T cachedValue)
Published a cached value.
|
Promise<T,S,E> |
promise()
Returns the promise for this deferred.
|
void |
reject(E error)
Publishes an error.
|
void |
resolve(T response)
Publishes a result.
|
void |
status(S status)
Publishes a status update.
|
public Deferred(java.lang.Class<E> errorClass)
errorClass - exception classpublic void cached(T cachedValue)
cachedValue - value to be publishedpublic void resolve(T response)
response - value to be publishedpublic void status(S status)
status - status to be publishedpublic void reject(E error)
error - error to be published