| Package | Description |
|---|---|
| io.atlassian.util.concurrent |
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Promises.SettablePromise<A>
A promise that can be completed with a successful value or a failed
exception.
|
| Modifier and Type | Method and Description |
|---|---|
Promise<A> |
Promise.done(Consumer<? super A> c)
Registers a callback to be called when the promised object is available.
|
Promise<A> |
Promise.fail(Consumer<Throwable> c)
Registers a callback to be called when an exception is thrown.
|
<B> Promise<B> |
Promise.flatMap(Function<? super A,? extends Promise<? extends B>> function)
Transforms this promise from one type to another by way of a transformation
function that returns a new Promise, leaving the strategy for that promise
production up to the function.
|
<B> Promise<B> |
Promise.fold(Function<Throwable,? extends B> handleThrowable,
Function<? super A,? extends B> function)
Transform this promise from one type to another, also providing a strategy
for dealing with any exceptions encountered.
|
static <A> Promise<A> |
Promises.forCompletionStage(CompletionStage<A> stage)
Create a promise from the input completion stage.
|
static <A> Promise<A> |
Promises.forCompletionStage(CompletionStage<A> stage,
Optional<Executor> executor)
Create a promise from the input completion stage.
|
static <A> Promise<A> |
Promises.forFuture(Future<A> future,
Executor executor)
Creates a promise from the given future.
|
<B> Promise<B> |
Promise.map(Function<? super A,? extends B> function)
Transforms this
Promise from one type
to another by way of a transformation function. |
static <A> Promise<A> |
Promises.promise(A value)
Creates a new, resolved promise for the specified concrete value.
|
Promise<A> |
Promise.recover(Function<Throwable,? extends A> handleThrowable)
Recover from an exception using the supplied exception strategy
|
static <A> Promise<A> |
Promises.rejected(Throwable t)
Creates a new, rejected promise from the given
Throwable
and result type. |
<T> Promise<T> |
ExecutorSubmitter.submit(Callable<T> task)
Submits a value-returning task for execution and returns a Promise
representing the pending results of the task.
|
<T> Promise<T> |
ExecutorSubmitter.submitSupplier(Supplier<T> task)
Submits a value-returning task for execution and returns a Promise
representing the pending results of the task.
|
Promise<A> |
Promise.then(Promise.TryConsumer<? super A> callback)
Registers a TryConsumer to handle both success and failure (exception)
cases.
|
static <A> Promise<List<A>> |
Promises.when(Iterable<? extends Promise<? extends A>> promises)
Returns a new
Promise representing the
status of a list of other promises. |
static <A> Promise<List<A>> |
Promises.when(Promise<? extends A>... promises)
Returns a new
Promise representing the
status of a list of other promises. |
static <A> Promise<List<A>> |
Promises.when(Stream<? extends Promise<? extends A>> promises)
Returns a new
Promise representing the
status of a stream of other promises. |
| Modifier and Type | Method and Description |
|---|---|
static <A> Function<A,Promise<A>> |
Promises.toPromise()
Deprecated.
use
Promises.promise(Object) as a method reference. |
| Modifier and Type | Method and Description |
|---|---|
static <B,A extends B> |
Promises.toCompletableFuture(Promise<A> promise)
Return a completable future based on the input promise
|
static <A> Promise<List<A>> |
Promises.when(Promise<? extends A>... promises)
Returns a new
Promise representing the
status of a list of other promises. |
| Modifier and Type | Method and Description |
|---|---|
<B> Promise<B> |
Promise.flatMap(Function<? super A,? extends Promise<? extends B>> function)
Transforms this promise from one type to another by way of a transformation
function that returns a new Promise, leaving the strategy for that promise
production up to the function.
|
static <A> Promise<List<A>> |
Promises.when(Iterable<? extends Promise<? extends A>> promises)
Returns a new
Promise representing the
status of a list of other promises. |
static <A> Promise<List<A>> |
Promises.when(Stream<? extends Promise<? extends A>> promises)
Returns a new
Promise representing the
status of a stream of other promises. |
Copyright © 2016 Atlassian. All rights reserved.