V - the result typepublic interface Promise<V> extends Future<V>, Terminable
This interface carries similar method signatures to those of
CompletionStage and CompletableFuture.
However, a distinction is made between actions which are executed on the main server thread vs asynchronously.
EMPTY| Modifier and Type | Method and Description |
|---|---|
default boolean |
cancel()
Attempts to cancel execution of this task.
|
static <U> Promise<U> |
completed(U value)
Returns a Promise which is already completed with the given value.
|
static <U> Promise<U> |
empty()
Returns a new empty Promise
|
default Promise<V> |
exceptionally(ThreadContext context,
Function<Throwable,? extends V> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function.
|
static <U> Promise<U> |
exceptionally(Throwable exception)
Returns a Promise which is already completed with the given exception.
|
Promise<V> |
exceptionallyAsync(Function<Throwable,? extends V> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function.
|
default Promise<V> |
exceptionallyDelayed(ThreadContext context,
Function<Throwable,? extends V> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
default Promise<V> |
exceptionallyDelayed(ThreadContext context,
Function<Throwable,? extends V> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
Promise<V> |
exceptionallyDelayedAsync(Function<Throwable,? extends V> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
Promise<V> |
exceptionallyDelayedAsync(Function<Throwable,? extends V> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
Promise<V> |
exceptionallyDelayedSync(Function<Throwable,? extends V> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
Promise<V> |
exceptionallyDelayedSync(Function<Throwable,? extends V> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function, after the delay has elapsed.
|
Promise<V> |
exceptionallySync(Function<Throwable,? extends V> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's exception as the argument to the given
function.
|
V |
getNow(V valueIfAbsent)
Returns the result value (or throws any encountered exception)
if completed, else returns the given valueIfAbsent.
|
V |
join()
Returns the result value when complete, or throws an
(unchecked) exception if completed exceptionally.
|
static Promise<Void> |
start()
Returns a new base promise to be built on top of.
|
default Promise<V> |
supply(ThreadContext context,
Supplier<V> supplier)
Schedules the supply of the Promise's result, via the given supplier.
|
Promise<V> |
supply(V value)
Supplies the Promise's result.
|
Promise<V> |
supplyAsync(Supplier<V> supplier)
Schedules the supply of the Promise's result, via the given supplier.
|
default Promise<V> |
supplyDelayed(ThreadContext context,
Supplier<V> supplier,
long delayTicks)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
default Promise<V> |
supplyDelayed(ThreadContext context,
Supplier<V> supplier,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
Promise<V> |
supplyDelayedAsync(Supplier<V> supplier,
long delayTicks)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
Promise<V> |
supplyDelayedAsync(Supplier<V> supplier,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
Promise<V> |
supplyDelayedSync(Supplier<V> supplier,
long delayTicks)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
Promise<V> |
supplyDelayedSync(Supplier<V> supplier,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given supplier,
after the delay has elapsed.
|
Promise<V> |
supplyException(Throwable exception)
Supplies an exceptional result to the Promise.
|
default Promise<V> |
supplyExceptionally(ThreadContext context,
Callable<V> callable)
Schedules the supply of the Promise's result, via the given callable.
|
Promise<V> |
supplyExceptionallyAsync(Callable<V> callable)
Schedules the supply of the Promise's result, via the given callable.
|
default Promise<V> |
supplyExceptionallyDelayed(ThreadContext context,
Callable<V> callable,
long delayTicks)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
default Promise<V> |
supplyExceptionallyDelayed(ThreadContext context,
Callable<V> callable,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
Promise<V> |
supplyExceptionallyDelayedAsync(Callable<V> callable,
long delayTicks)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
Promise<V> |
supplyExceptionallyDelayedAsync(Callable<V> callable,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
Promise<V> |
supplyExceptionallyDelayedSync(Callable<V> callable,
long delayTicks)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
Promise<V> |
supplyExceptionallyDelayedSync(Callable<V> callable,
long delay,
TimeUnit unit)
Schedules the supply of the Promise's result, via the given callable,
after the delay has elapsed.
|
Promise<V> |
supplyExceptionallySync(Callable<V> callable)
Schedules the supply of the Promise's result, via the given callable.
|
static <U> Promise<U> |
supplying(ThreadContext context,
Supplier<U> supplier)
Returns a new Promise, and schedules it's population via the given supplier.
|
static <U> Promise<U> |
supplyingAsync(Supplier<U> supplier)
Returns a new Promise, and schedules it's population via the given supplier.
|
static <U> Promise<U> |
supplyingDelayed(ThreadContext context,
Supplier<U> supplier,
long delayTicks)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingDelayed(ThreadContext context,
Supplier<U> supplier,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingDelayedAsync(Supplier<U> supplier,
long delayTicks)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingDelayedAsync(Supplier<U> supplier,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingDelayedSync(Supplier<U> supplier,
long delayTicks)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingDelayedSync(Supplier<U> supplier,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given supplier,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionally(ThreadContext context,
Callable<U> callable)
Returns a new Promise, and schedules it's population via the given callable.
|
static <U> Promise<U> |
supplyingExceptionallyAsync(Callable<U> callable)
Returns a new Promise, and schedules it's population via the given callable.
|
static <U> Promise<U> |
supplyingExceptionallyDelayed(ThreadContext context,
Callable<U> callable,
long delayTicks)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallyDelayed(ThreadContext context,
Callable<U> callable,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallyDelayedAsync(Callable<U> callable,
long delayTicks)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallyDelayedAsync(Callable<U> callable,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallyDelayedSync(Callable<U> callable,
long delayTicks)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallyDelayedSync(Callable<U> callable,
long delay,
TimeUnit unit)
Returns a new Promise, and schedules it's population via the given callable,
after the delay has elapsed.
|
static <U> Promise<U> |
supplyingExceptionallySync(Callable<U> callable)
Returns a new Promise, and schedules it's population via the given callable.
|
static <U> Promise<U> |
supplyingSync(Supplier<U> supplier)
Returns a new Promise, and schedules it's population via the given supplier.
|
Promise<V> |
supplySync(Supplier<V> supplier)
Schedules the supply of the Promise's result, via the given supplier.
|
default Promise<Void> |
thenAccept(ThreadContext context,
Consumer<? super V> action)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action.
|
default Promise<Void> |
thenAcceptAsync(Consumer<? super V> action)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action.
|
default Promise<Void> |
thenAcceptDelayed(ThreadContext context,
Consumer<? super V> action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptDelayed(ThreadContext context,
Consumer<? super V> action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptDelayedAsync(Consumer<? super V> action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptDelayedAsync(Consumer<? super V> action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptDelayedSync(Consumer<? super V> action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptDelayedSync(Consumer<? super V> action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action, after the delay has elapsed.
|
default Promise<Void> |
thenAcceptSync(Consumer<? super V> action)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
action.
|
default <U> Promise<U> |
thenApply(ThreadContext context,
Function<? super V,? extends U> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
<U> Promise<U> |
thenApplyAsync(Function<? super V,? extends U> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
default <U> Promise<U> |
thenApplyDelayed(ThreadContext context,
Function<? super V,? extends U> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
default <U> Promise<U> |
thenApplyDelayed(ThreadContext context,
Function<? super V,? extends U> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenApplyDelayedAsync(Function<? super V,? extends U> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenApplyDelayedAsync(Function<? super V,? extends U> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenApplyDelayedSync(Function<? super V,? extends U> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenApplyDelayedSync(Function<? super V,? extends U> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenApplySync(Function<? super V,? extends U> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
default <U> Promise<U> |
thenCompose(ThreadContext context,
Function<? super V,? extends Promise<U>> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
<U> Promise<U> |
thenComposeAsync(Function<? super V,? extends Promise<U>> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
<U> Promise<U> |
thenComposeDelayedAsync(Function<? super V,? extends Promise<U>> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenComposeDelayedAsync(Function<? super V,? extends Promise<U>> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenComposeDelayedSync(Function<? super V,? extends Promise<U>> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenComposeDelayedSync(Function<? super V,? extends Promise<U>> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
default <U> Promise<U> |
thenComposeDelayedSync(ThreadContext context,
Function<? super V,? extends Promise<U>> fn,
long delayTicks)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
default <U> Promise<U> |
thenComposeDelayedSync(ThreadContext context,
Function<? super V,? extends Promise<U>> fn,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function, after the delay has elapsed.
|
<U> Promise<U> |
thenComposeSync(Function<? super V,? extends Promise<U>> fn)
Returns a new Promise that, when this promise completes normally, is
executed with this promise's result as the argument to the given
function.
|
default Promise<Void> |
thenRun(ThreadContext context,
Runnable action)
Returns a new Promise that, when this promise completes normally, executes
the given task.
|
default Promise<Void> |
thenRunAsync(Runnable action)
Returns a new Promise that, when this promise completes normally, executes
the given task.
|
default Promise<Void> |
thenRunDelayed(ThreadContext context,
Runnable action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunDelayed(ThreadContext context,
Runnable action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunDelayedAsync(Runnable action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunDelayedAsync(Runnable action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunDelayedSync(Runnable action,
long delayTicks)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunDelayedSync(Runnable action,
long delay,
TimeUnit unit)
Returns a new Promise that, when this promise completes normally, executes
the given task, after the delay has elapsed.
|
default Promise<Void> |
thenRunSync(Runnable action)
Returns a new Promise that, when this promise completes normally, executes
the given task.
|
CompletableFuture<V> |
toCompletableFuture()
Returns a
CompletableFuture maintaining the same
completion properties as this Promise. |
static <U> Promise<U> |
wrapFuture(Future<U> future)
Returns a Promise which represents the given future.
|
bindWith, close, closeAndReportException, closeSilently, isClosed@Nonnull static <U> Promise<U> empty()
An empty promise can be 'completed' via the supply methods.
U - the result type@Nonnull static Promise<Void> start()
@Nonnull static <U> Promise<U> completed(@Nullable U value)
U - the result typevalue - the value@Nonnull static <U> Promise<U> exceptionally(@Nonnull Throwable exception)
U - the result typeexception - the exception@Nonnull static <U> Promise<U> wrapFuture(@Nonnull Future<U> future)
The implementation will make an attempt to wrap the future without creating a new process
to await the result (by casting to CompletionStage or
ListenableFuture).
Calls to cancel the returned promise will not affected the wrapped
future.
U - the result typefuture - the future to wrap@Nonnull static <U> Promise<U> supplying(@Nonnull ThreadContext context, @Nonnull Supplier<U> supplier)
U - the result typecontext - the type of executor to use to supply the promisesupplier - the value supplier@Nonnull static <U> Promise<U> supplyingSync(@Nonnull Supplier<U> supplier)
U - the result typesupplier - the value supplier@Nonnull static <U> Promise<U> supplyingAsync(@Nonnull Supplier<U> supplier)
U - the result typesupplier - the value supplier@Nonnull static <U> Promise<U> supplyingDelayed(@Nonnull ThreadContext context, @Nonnull Supplier<U> supplier, long delayTicks)
U - the result typecontext - the type of executor to use to supply the promisesupplier - the value supplierdelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingDelayed(@Nonnull ThreadContext context, @Nonnull Supplier<U> supplier, long delay, @Nonnull TimeUnit unit)
U - the result typecontext - the type of executor to use to supply the promisesupplier - the value supplierdelay - the delayunit - the unit of delay@Nonnull static <U> Promise<U> supplyingDelayedSync(@Nonnull Supplier<U> supplier, long delayTicks)
U - the result typesupplier - the value supplierdelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingDelayedSync(@Nonnull Supplier<U> supplier, long delay, @Nonnull TimeUnit unit)
U - the result typesupplier - the value supplierdelay - the delayunit - the unit of delay@Nonnull static <U> Promise<U> supplyingDelayedAsync(@Nonnull Supplier<U> supplier, long delayTicks)
U - the result typesupplier - the value supplierdelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingDelayedAsync(@Nonnull Supplier<U> supplier, long delay, @Nonnull TimeUnit unit)
U - the result typesupplier - the value supplierdelay - the delayunit - the unit of delay@Nonnull static <U> Promise<U> supplyingExceptionally(@Nonnull ThreadContext context, @Nonnull Callable<U> callable)
U - the result typecontext - the type of executor to use to supply the promisecallable - the value callable@Nonnull static <U> Promise<U> supplyingExceptionallySync(@Nonnull Callable<U> callable)
U - the result typecallable - the value callable@Nonnull static <U> Promise<U> supplyingExceptionallyAsync(@Nonnull Callable<U> callable)
U - the result typecallable - the value callable@Nonnull static <U> Promise<U> supplyingExceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Callable<U> callable, long delayTicks)
U - the result typecontext - the type of executor to use to supply the promisecallable - the value callabledelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingExceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Callable<U> callable, long delay, @Nonnull TimeUnit unit)
U - the result typecontext - the type of executor to use to supply the promisecallable - the value callabledelay - the delayunit - the unit of delay@Nonnull static <U> Promise<U> supplyingExceptionallyDelayedSync(@Nonnull Callable<U> callable, long delayTicks)
U - the result typecallable - the value callabledelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingExceptionallyDelayedSync(@Nonnull Callable<U> callable, long delay, @Nonnull TimeUnit unit)
U - the result typecallable - the value callabledelay - the delayunit - the unit of delay@Nonnull static <U> Promise<U> supplyingExceptionallyDelayedAsync(@Nonnull Callable<U> callable, long delayTicks)
U - the result typecallable - the value callabledelayTicks - the delay in ticks@Nonnull static <U> Promise<U> supplyingExceptionallyDelayedAsync(@Nonnull Callable<U> callable, long delay, @Nonnull TimeUnit unit)
U - the result typecallable - the value callabledelay - the delayunit - the unit of delaydefault boolean cancel()
false if the task could not be cancelled, typically
because it has already completed normally;
true otherwiseV join()
To better conform with the use of common functional forms, if a
computation involved in the completion of this
Promise threw an exception, this method throws an
(unchecked) CompletionException with the underlying
exception as its cause.
CancellationException - if the computation was cancelledCompletionException - if this future completed
exceptionally or a completion computation threw an exceptionV getNow(V valueIfAbsent)
valueIfAbsent - the value to return if not completedCancellationException - if the computation was cancelledCompletionException - if this future completed
exceptionally or a completion computation threw an exception@Nonnull Promise<V> supply(@Nullable V value)
value - the object to pass to the promiseIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyException(@Nonnull Throwable exception)
exception - the exception to supplyIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supply(@Nonnull ThreadContext context, @Nonnull Supplier<V> supplier)
context - the type of executor to use to supply the promisesupplier - the supplierIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplySync(@Nonnull Supplier<V> supplier)
supplier - the supplierIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyAsync(@Nonnull Supplier<V> supplier)
supplier - the supplierIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supplyDelayed(@Nonnull ThreadContext context, @Nonnull Supplier<V> supplier, long delayTicks)
context - the type of executor to use to supply the promisesupplier - the supplierdelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supplyDelayed(@Nonnull ThreadContext context, @Nonnull Supplier<V> supplier, long delay, @Nonnull TimeUnit unit)
context - the type of executor to use to supply the promisesupplier - the supplierdelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyDelayedSync(@Nonnull Supplier<V> supplier, long delayTicks)
supplier - the supplierdelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyDelayedSync(@Nonnull Supplier<V> supplier, long delay, @Nonnull TimeUnit unit)
supplier - the supplierdelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyDelayedAsync(@Nonnull Supplier<V> supplier, long delayTicks)
supplier - the supplierdelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyDelayedAsync(@Nonnull Supplier<V> supplier, long delay, @Nonnull TimeUnit unit)
supplier - the supplierdelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supplyExceptionally(@Nonnull ThreadContext context, @Nonnull Callable<V> callable)
context - the type of executor to use to supply the promisecallable - the callableIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallySync(@Nonnull Callable<V> callable)
callable - the callableIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallyAsync(@Nonnull Callable<V> callable)
callable - the callableIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supplyExceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Callable<V> callable, long delayTicks)
context - the type of executor to use to supply the promisecallable - the callabledelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default Promise<V> supplyExceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Callable<V> callable, long delay, @Nonnull TimeUnit unit)
context - the type of executor to use to supply the promisecallable - the callabledelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallyDelayedSync(@Nonnull Callable<V> callable, long delayTicks)
callable - the callabledelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallyDelayedSync(@Nonnull Callable<V> callable, long delay, @Nonnull TimeUnit unit)
callable - the callabledelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallyDelayedAsync(@Nonnull Callable<V> callable, long delayTicks)
callable - the callabledelayTicks - the delay in ticksIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull Promise<V> supplyExceptionallyDelayedAsync(@Nonnull Callable<V> callable, long delay, @Nonnull TimeUnit unit)
callable - the callabledelay - the delayunit - the unit of delayIllegalStateException - if the promise is already being supplied, or has already been completed.@Nonnull default <U> Promise<U> thenApply(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends U> fn)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the value@Nonnull <U> Promise<U> thenApplySync(@Nonnull Function<? super V,? extends U> fn)
U - the result typefn - the function to use to compute the value@Nonnull <U> Promise<U> thenApplyAsync(@Nonnull Function<? super V,? extends U> fn)
U - the result typefn - the function to use to compute the value@Nonnull default <U> Promise<U> thenApplyDelayed(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends U> fn, long delayTicks)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull default <U> Promise<U> thenApplyDelayed(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends U> fn, long delay, @Nonnull TimeUnit unit)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull <U> Promise<U> thenApplyDelayedSync(@Nonnull Function<? super V,? extends U> fn, long delayTicks)
U - the result typefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull <U> Promise<U> thenApplyDelayedSync(@Nonnull Function<? super V,? extends U> fn, long delay, @Nonnull TimeUnit unit)
U - the result typefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull <U> Promise<U> thenApplyDelayedAsync(@Nonnull Function<? super V,? extends U> fn, long delayTicks)
U - the result typefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull <U> Promise<U> thenApplyDelayedAsync(@Nonnull Function<? super V,? extends U> fn, long delay, @Nonnull TimeUnit unit)
U - the result typefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenAccept(@Nonnull ThreadContext context, @Nonnull Consumer<? super V> action)
context - the type of executor to use to supply the promiseaction - the action to perform before completing the returned future@Nonnull default Promise<Void> thenAcceptSync(@Nonnull Consumer<? super V> action)
action - the action to perform before completing the returned future@Nonnull default Promise<Void> thenAcceptAsync(@Nonnull Consumer<? super V> action)
action - the action to perform before completing the returned future@Nonnull default Promise<Void> thenAcceptDelayed(@Nonnull ThreadContext context, @Nonnull Consumer<? super V> action, long delayTicks)
context - the type of executor to use to supply the promiseaction - the action to perform before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenAcceptDelayed(@Nonnull ThreadContext context, @Nonnull Consumer<? super V> action, long delay, @Nonnull TimeUnit unit)
context - the type of executor to use to supply the promiseaction - the action to perform before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenAcceptDelayedSync(@Nonnull Consumer<? super V> action, long delayTicks)
action - the action to perform before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenAcceptDelayedSync(@Nonnull Consumer<? super V> action, long delay, @Nonnull TimeUnit unit)
action - the action to perform before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenAcceptDelayedAsync(@Nonnull Consumer<? super V> action, long delayTicks)
action - the action to perform before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenAcceptDelayedAsync(@Nonnull Consumer<? super V> action, long delay, @Nonnull TimeUnit unit)
action - the action to perform before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenRun(@Nonnull ThreadContext context, @Nonnull Runnable action)
context - the type of executor to use to supply the promiseaction - the action to run before completing the returned future@Nonnull default Promise<Void> thenRunSync(@Nonnull Runnable action)
action - the action to run before completing the returned future@Nonnull default Promise<Void> thenRunAsync(@Nonnull Runnable action)
action - the action to run before completing the returned future@Nonnull default Promise<Void> thenRunDelayed(@Nonnull ThreadContext context, @Nonnull Runnable action, long delayTicks)
context - the type of executor to use to supply the promiseaction - the action to run before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenRunDelayed(@Nonnull ThreadContext context, @Nonnull Runnable action, long delay, @Nonnull TimeUnit unit)
context - the type of executor to use to supply the promiseaction - the action to run before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenRunDelayedSync(@Nonnull Runnable action, long delayTicks)
action - the action to run before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenRunDelayedSync(@Nonnull Runnable action, long delay, @Nonnull TimeUnit unit)
action - the action to run before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default Promise<Void> thenRunDelayedAsync(@Nonnull Runnable action, long delayTicks)
action - the action to run before completing the returned futuredelayTicks - the delay in ticks@Nonnull default Promise<Void> thenRunDelayedAsync(@Nonnull Runnable action, long delay, @Nonnull TimeUnit unit)
action - the action to run before completing the returned futuredelay - the delayunit - the unit of delay@Nonnull default <U> Promise<U> thenCompose(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends Promise<U>> fn)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the value@Nonnull <U> Promise<U> thenComposeSync(@Nonnull Function<? super V,? extends Promise<U>> fn)
U - the result typefn - the function to use to compute the value@Nonnull <U> Promise<U> thenComposeAsync(@Nonnull Function<? super V,? extends Promise<U>> fn)
U - the result typefn - the function to use to compute the value@Nonnull default <U> Promise<U> thenComposeDelayedSync(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends Promise<U>> fn, long delayTicks)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull default <U> Promise<U> thenComposeDelayedSync(@Nonnull ThreadContext context, @Nonnull Function<? super V,? extends Promise<U>> fn, long delay, @Nonnull TimeUnit unit)
U - the result typecontext - the type of executor to use to supply the promisefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull <U> Promise<U> thenComposeDelayedSync(@Nonnull Function<? super V,? extends Promise<U>> fn, long delayTicks)
U - the result typefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull <U> Promise<U> thenComposeDelayedSync(@Nonnull Function<? super V,? extends Promise<U>> fn, long delay, @Nonnull TimeUnit unit)
U - the result typefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull <U> Promise<U> thenComposeDelayedAsync(@Nonnull Function<? super V,? extends Promise<U>> fn, long delayTicks)
U - the result typefn - the function to use to compute the valuedelayTicks - the delay in ticks@Nonnull <U> Promise<U> thenComposeDelayedAsync(@Nonnull Function<? super V,? extends Promise<U>> fn, long delay, @Nonnull TimeUnit unit)
U - the result typefn - the function to use to compute the valuedelay - the delayunit - the unit of delay@Nonnull default Promise<V> exceptionally(@Nonnull ThreadContext context, @Nonnull Function<Throwable,? extends V> fn)
context - the type of executor to use to supply the promisefn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionally@Nonnull Promise<V> exceptionallySync(@Nonnull Function<Throwable,? extends V> fn)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionally@Nonnull Promise<V> exceptionallyAsync(@Nonnull Function<Throwable,? extends V> fn)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionally@Nonnull default Promise<V> exceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Function<Throwable,? extends V> fn, long delayTicks)
context - the type of executor to use to supply the promisefn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelayTicks - the delay in ticks@Nonnull default Promise<V> exceptionallyDelayed(@Nonnull ThreadContext context, @Nonnull Function<Throwable,? extends V> fn, long delay, @Nonnull TimeUnit unit)
context - the type of executor to use to supply the promisefn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelay - the delayunit - the unit of delay@Nonnull Promise<V> exceptionallyDelayedSync(@Nonnull Function<Throwable,? extends V> fn, long delayTicks)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelayTicks - the delay in ticks@Nonnull Promise<V> exceptionallyDelayedSync(@Nonnull Function<Throwable,? extends V> fn, long delay, @Nonnull TimeUnit unit)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelay - the delayunit - the unit of delay@Nonnull Promise<V> exceptionallyDelayedAsync(@Nonnull Function<Throwable,? extends V> fn, long delayTicks)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelayTicks - the delay in ticks@Nonnull Promise<V> exceptionallyDelayedAsync(@Nonnull Function<Throwable,? extends V> fn, long delay, @Nonnull TimeUnit unit)
fn - the function to use to compute the value of the returned
Promise, if this promise completed exceptionallydelay - the delayunit - the unit of delayCompletableFuture<V> toCompletableFuture()
CompletableFuture maintaining the same
completion properties as this Promise.
A Promise implementation that does not choose to interoperate
with CompletableFutures may throw UnsupportedOperationException.UnsupportedOperationException - if this implementation
does not interoperate with CompletableFutureCopyright © 2022. All rights reserved.