public final class Promises
extends java.lang.Object
Promise
instances.Constructor and Description |
---|
Promises() |
Modifier and Type | Method and Description |
---|---|
static <T> Promise<T> |
any(java.util.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(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
java.lang.Throwable error)
|
static <T> Promise<T> |
error(reactor.Environment env,
java.lang.Throwable error)
|
static <T> Promise<T> |
error(java.lang.Throwable error)
|
static <T> Promise<T> |
prepare()
Create a synchronous
Promise . |
static <T> Promise<T> |
prepare(reactor.Environment env)
Create a
Promise . |
static <T> Promise<T> |
ready(reactor.Environment env,
reactor.core.Dispatcher dispatcher)
Create a
Promise . |
static Promise<java.lang.Void> |
success()
Create a
Promise already completed without any data. |
static <T> Promise<T> |
success(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
T value)
|
static <T> Promise<T> |
success(reactor.Environment env,
T value)
|
static <T> Promise<T> |
success(T value)
|
static <T> Promise<T> |
syncTask(reactor.fn.Supplier<T> supplier)
|
static <T> Promise<T> |
task(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
reactor.fn.Supplier<T> supplier)
|
static <T> Promise<T> |
task(reactor.Environment env,
reactor.fn.Supplier<T> supplier)
|
static <T> Promise<java.util.List<T>> |
when(java.util.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<reactor.fn.tuple.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<reactor.fn.tuple.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(reactor.Environment env)
Promise
.T
- type of the expected valueenv
- the Environment
to usePromise
public static <T> Promise<T> ready(reactor.Environment env, reactor.core.Dispatcher dispatcher)
Promise
.T
- type of the expected valueenv
- the Environment
to usedispatcher
- the Dispatcher
to usePromise
public static <T> Promise<T> syncTask(reactor.fn.Supplier<T> supplier)
T
- type of the expected valuesupplier
- Supplier
that will produce the valuePromise
.public static <T> Promise<T> task(reactor.Environment env, reactor.fn.Supplier<T> supplier)
T
- type of the expected valuesupplier
- Supplier
that will produce the valueenv
- The assigned environmentPromise
.public static <T> Promise<T> task(reactor.Environment env, reactor.core.Dispatcher dispatcher, reactor.fn.Supplier<T> supplier)
T
- type of the expected valuesupplier
- Supplier
that will produce the valueenv
- The assigned environmentdispatcher
- The dispatcher to schedule the valuePromise
.public static <T> Promise<T> success(T value)
public static Promise<java.lang.Void> success()
Promise
already completed without any data.Promise
that is completedpublic static <T> Promise<T> success(reactor.Environment env, T value)
public static <T> Promise<T> success(reactor.Environment env, reactor.core.Dispatcher dispatcher, T value)
public static <T> Promise<T> error(java.lang.Throwable error)
public static <T> Promise<T> error(reactor.Environment env, java.lang.Throwable error)
public static <T> Promise<T> error(reactor.Environment env, reactor.core.Dispatcher dispatcher, java.lang.Throwable error)
public static <T1,T2> Promise<reactor.fn.tuple.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<reactor.fn.tuple.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<reactor.fn.tuple.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<reactor.fn.tuple.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<reactor.fn.tuple.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<reactor.fn.tuple.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<reactor.fn.tuple.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<java.util.List<T>> when(java.util.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
.