T - the type of the value that the Promise will containpublic final class PromiseSpec<T> extends ComposableSpec<PromiseSpec<T>,Promise<T>>
Promise.| Constructor and Description |
|---|
PromiseSpec() |
| Modifier and Type | Method and Description |
|---|---|
protected Promise<T> |
createComposable(Environment env,
Observable observable,
Tuple2<Selector,java.lang.Object> accept) |
PromiseSpec<T> |
error(java.lang.Throwable error)
Configures the promise to have been completed with the given
error. |
PromiseSpec<T> |
success(T value)
Configures the promise to have been successfully completed with the given
value. |
PromiseSpec<T> |
supply(Supplier<T> valueSupplier)
Configures the promise to have been successfully completed with the value from the given
valueSupplier. |
configureactorSystem, actorSystem, defaultDispatcher, dispatcher, dispatcher, env, get, synchronousDispatcherpublic PromiseSpec<T> success(T value)
value.value - The value for the promise to containthispublic PromiseSpec<T> supply(Supplier<T> valueSupplier)
valueSupplier.valueSupplier - The supplier of the value for the promise to containthispublic PromiseSpec<T> error(java.lang.Throwable error)
error.error - The error to be held by the Promisethisprotected Promise<T> createComposable(Environment env, Observable observable, Tuple2<Selector,java.lang.Object> accept)
createComposable in class ComposableSpec<PromiseSpec<T>,Promise<T>>