Package | Description |
---|---|
sirius.kernel.async |
Provides a framework for asynchronous execution of given tasks.
|
Modifier and Type | Class and Description |
---|---|
class |
Future
Represents an untyped
Promise where the completion or failure is more important than the result itself. |
Modifier and Type | Method and Description |
---|---|
Promise<V> |
Promise.doNotLogErrors()
Disables the error logging even if no failure handlers are present.
|
Promise<V> |
Promise.fail(Throwable exception)
Marks the promise as failed due to the given error.
|
<X> Promise<V> |
Promise.failChain(Promise<X> promise,
Callback<V> successHandler)
Forwards failures to the given promise, while sending successful value to the given successHandler.
|
<X> Promise<X> |
Promise.flatMap(Function<V,Promise<X>> mapper)
Uses to result of this promise to generate a new promise using the given mapper.
|
<V> Promise<V> |
Tasks.fork(String category,
Supplier<V> computation)
Forks the given computation and returns a
Promise for the computed value. |
Promise<V> |
Promise.handleErrors(Log log)
Adds an error handler, which handles failures by logging them to the given
Log
By default, if no explicit completion handler is present, all failures are logged using the async
logger. |
<X> Promise<X> |
Promise.map(Function<V,X> mapper)
Used the result of this promise to create a new one by passing the resulting value into the given mapper.
|
Promise<V> |
Promise.onComplete(CompletionHandler<V> handler)
Adds a completion handler to this promise.
|
Promise<V> |
Promise.onFailure(Consumer<Throwable> failureHandler)
Adds a completion handler to this promise which only handles the failed completion of the promise.
|
Promise<V> |
Promise.onFailureCallback(Callback<Throwable> failureHandler)
Adds a completion handler to this promise which only handles the failed completion of the promise.
|
Promise<V> |
Promise.onSuccess(Consumer<V> successHandler)
Adds a completion handler to this promise which only handles the successful completion of the promise.
|
Promise<V> |
Promise.onSuccessCallback(Callback<V> successHandler)
Adds a completion handler to this promise which only handles the successful completion of the promise.
|
static <V> Promise<List<V>> |
Tasks.sequence(List<Promise<V>> list)
Turns a list of promises into a promise for a list of values.
|
Promise<V> |
Promise.success(V value)
Marks the promise as successful and completed with the given value.
|
Modifier and Type | Method and Description |
---|---|
void |
Barrier.add(Promise<?> promise)
Adds a promise to the barrier which will be waited for.
|
void |
Promise.chain(Promise<V> promise)
Chains this promise to the given one.
|
<X> Promise<V> |
Promise.failChain(Promise<X> promise,
Callback<V> successHandler)
Forwards failures to the given promise, while sending successful value to the given successHandler.
|
<X> void |
Promise.mapChain(Promise<X> promise,
Function<V,X> mapper)
Chains this promise to the given one, by transforming the result value of this promise using the given mapper.
|
Modifier and Type | Method and Description |
---|---|
<X> Promise<X> |
Promise.flatMap(Function<V,Promise<X>> mapper)
Uses to result of this promise to generate a new promise using the given mapper.
|
static <V> Promise<List<V>> |
Tasks.sequence(List<Promise<V>> list)
Turns a list of promises into a promise for a list of values.
|
Copyright © 2018. All rights reserved.