Constructor and Description |
---|
Promises() |
Modifier and Type | Method and Description |
---|---|
static <T> Promise<T> |
any(List<? extends Promise<T>> promises)
Pick the first result coming from any of the given promises and populate a new Promise.
|
static <T> Promise<T> |
any(Promise<T>... promises)
Pick the first result coming from any of the given promises and populate a new Promise.
|
static <T> Promise<T> |
error(Environment env,
Dispatcher dispatcher,
Throwable error)
|
static <T> Promise<T> |
error(Environment env,
Throwable error)
|
static <T> Promise<T> |
error(Throwable error)
|
static <T> Promise<T> |
prepare()
Create a synchronous
Promise . |
static <T> Promise<T> |
prepare(Environment env)
Create a
Promise . |
static <T> Promise<T> |
ready(Environment env,
Dispatcher dispatcher)
Create a
Promise . |
static Promise<Void> |
success()
Create a
Promise already completed without any data. |
static <T> Promise<T> |
success(Environment env,
Dispatcher dispatcher,
T value)
|
static <T> Promise<T> |
success(Environment env,
T value)
|
static <T> Promise<T> |
success(T value)
|
static <T> Promise<T> |
syncTask(Supplier<T> supplier)
|
static <T> Promise<T> |
task(Environment env,
Dispatcher dispatcher,
Supplier<T> supplier)
|
static <T> Promise<T> |
task(Environment env,
Supplier<T> supplier)
|
static <T> Promise<List<T>> |
when(List<? extends Promise<T>> promises)
Aggregate given promises into a new a Promise that will be fulfilled when all of the given Promise Promises have been fulfilled.
|
static <T1,T2> Promise<Tuple2<T1,T2>> |
when(Promise<T1> p1,
Promise<T2> p2)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3> Promise<Tuple3<T1,T2,T3>> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3,T4> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3,
Promise<T4> p4)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3,T4,T5> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3,
Promise<T4> p4,
Promise<T5> p5)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3,T4,T5,T6> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3,
Promise<T4> p4,
Promise<T5> p5,
Promise<T6> p6)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3,T4,T5,T6,T7> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3,
Promise<T4> p4,
Promise<T5> p5,
Promise<T6> p6,
Promise<T7> p7)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
static <T1,T2,T3,T4,T5,T6,T7,T8> |
when(Promise<T1> p1,
Promise<T2> p2,
Promise<T3> p3,
Promise<T4> p4,
Promise<T5> p5,
Promise<T6> p6,
Promise<T7> p7,
Promise<T8> p8)
Merge given promises into a new a Promise that will be fulfilled when all of the given Promise
Promises have been fulfilled.
|
public static <T> Promise<T> prepare()
Promise
.T
- type of the expected valuePromise
.public static <T> Promise<T> prepare(Environment env)
Promise
.T
- type of the expected valueenv
- the Environment
to usePromise
public static <T> Promise<T> ready(Environment env, Dispatcher dispatcher)
Promise
.T
- type of the expected valueenv
- the Environment
to usedispatcher
- the Dispatcher
to usePromise
public static <T> Promise<T> task(Environment env, Supplier<T> supplier)
public static <T> Promise<T> task(Environment env, Dispatcher dispatcher, Supplier<T> supplier)
public static <T> Promise<T> success(T value)
public static Promise<Void> success()
Promise
already completed without any data.Promise
that is completedpublic static <T> Promise<T> success(Environment env, T value)
public static <T> Promise<T> success(Environment env, Dispatcher dispatcher, T value)
public static <T> Promise<T> error(Environment env, Throwable error)
public static <T> Promise<T> error(Environment env, Dispatcher dispatcher, Throwable error)
public static <T1,T2> Promise<Tuple2<T1,T2>> when(Promise<T1> p1, Promise<T2> p2)
T1,T2
- The type of the function Tuple result.p1,
- p2
The promises to use.Promise
.public static <T1,T2,T3> Promise<Tuple3<T1,T2,T3>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3)
T1,T2,T3
- The type of the function Tuple result.p1,
- p2, p3
The promises to use.Promise
.public static <T1,T2,T3,T4> Promise<Tuple4<T1,T2,T3,T4>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3, Promise<T4> p4)
T1,T2,T3,T4
- The type of the function Tuple result.p1,
- p2, p3, p4
The promises to use.Promise
.public static <T1,T2,T3,T4,T5> Promise<Tuple5<T1,T2,T3,T4,T5>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3, Promise<T4> p4, Promise<T5> p5)
T1,T2,T3,T4,T5
- The type of the function Tuple result.p1,
- p2, p3, p4, p5
The promises to use.Promise
.public static <T1,T2,T3,T4,T5,T6> Promise<Tuple6<T1,T2,T3,T4,T5,T6>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3, Promise<T4> p4, Promise<T5> p5, Promise<T6> p6)
T1,T2,T3,T4,T5,T6
- The type of the function Tuple result.p1,
- p2, p3, p4, p5, p6
The promises to use.Promise
.public static <T1,T2,T3,T4,T5,T6,T7> Promise<Tuple7<T1,T2,T3,T4,T5,T6,T7>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3, Promise<T4> p4, Promise<T5> p5, Promise<T6> p6, Promise<T7> p7)
T1,T2,T3,T4,T5,T6,T7
- The type of the function Tuple result.p1,
- p2, p3, p4, p5, p6, p7
The promises to use.Promise
.public static <T1,T2,T3,T4,T5,T6,T7,T8> Promise<Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>> when(Promise<T1> p1, Promise<T2> p2, Promise<T3> p3, Promise<T4> p4, Promise<T5> p5, Promise<T6> p6, Promise<T7> p7, Promise<T8> p8)
T1,T2,T3,T4,T5,T6,T7,T8
- The type of the function Tuple result.p1,
- p2, p3, p4, p5, p6, p7, p8
The promises to use.Promise
.public static <T> Promise<List<T>> when(List<? extends Promise<T>> promises)
T
- The type of the function result.promises
- The promises to use.Promise
.public static <T> Promise<T> any(Promise<T>... promises)
T
- The type of the function result.promises
- The deferred promises to use.Promise
.Copyright © 2017. All rights reserved.