public class Delay extends Object
| Modifier and Type | Method and Description |
|---|---|
static Executor |
delayedExecutor(long delay,
TimeUnit unit)
Returns a new Executor that submits a task to the default
executor after the given delay (or no delay if non-positive).
|
static <T> CompletableFuture<T> |
timeout(CompletableFuture<T> cf,
long timeout,
TimeUnit unit,
Supplier<TimeoutException> s)
Exceptionally completes the given CompletableFuture with
a
TimeoutException if not otherwise completed
before the given timeout. |
public static Executor delayedExecutor(long delay, TimeUnit unit)
execute method.delay - how long to delay, in units of unitunit - a TimeUnit determining how to interpret the
delay parameterpublic static <T> CompletableFuture<T> timeout(CompletableFuture<T> cf, long timeout, TimeUnit unit, Supplier<TimeoutException> s)
TimeoutException if not otherwise completed
before the given timeout.timeout - how long to wait before completing exceptionally
with a TimeoutException, in units of unitunit - a TimeUnit determining how to interpret the
timeout parameterCopyright © 2013–2019 mklinger GmbH. All rights reserved.