T - public class ContinuableFuture<T> extends Object implements Future<T>
Futures| Modifier and Type | Method and Description |
|---|---|
static <T> ContinuableFuture<T> |
call(Callable<T> action) |
static <T> ContinuableFuture<T> |
call(Callable<T> action,
Executor executor) |
<R> ContinuableFuture<R> |
callAfterBoth(ContinuableFuture<?> other,
Callable<R> action)
Call after both.
|
<U,R,E extends Exception> |
callAfterBoth(ContinuableFuture<U> other,
Throwables.BiFunction<? super T,? super U,R,E> action)
Call after both.
|
<U,R,E extends Exception> |
callAfterBoth(ContinuableFuture<U> other,
Throwables.Function<? super Tuple.Tuple4<T,? super Exception,U,? super Exception>,R,E> action)
Call after both.
|
<U,R,E extends Exception> |
callAfterBoth(ContinuableFuture<U> other,
Throwables.QuadFunction<T,? super Exception,U,? super Exception,R,E> action)
Call after both.
|
<R> ContinuableFuture<R> |
callAfterEither(ContinuableFuture<?> other,
Callable<R> action)
Call after either.
|
<R,E extends Exception> |
callAfterEither(ContinuableFuture<? extends T> other,
Throwables.BiFunction<? super T,? super Exception,R,E> action)
Call after either.
|
<R,E extends Exception> |
callAfterEither(ContinuableFuture<? extends T> other,
Throwables.Function<? super T,R,E> action)
Call after either.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
boolean |
cancelAll(boolean mayInterruptIfRunning)
Cancel this future and all the previous stage future recursively.
|
static <T> ContinuableFuture<T> |
completed(T result) |
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
T |
getNow(T defaultValue)
Gets the now.
|
Result<T,Exception> |
gett()
Gets the t.
|
Result<T,Exception> |
gett(long timeout,
TimeUnit unit)
Gets the t.
|
<E extends Exception> |
getThenAccept(long timeout,
TimeUnit unit,
Throwables.BiConsumer<? super T,? super Exception,E> action)
Gets the then accept.
|
<E extends Exception> |
getThenAccept(long timeout,
TimeUnit unit,
Throwables.Consumer<? super T,E> action)
Gets the then accept.
|
<E extends Exception> |
getThenAccept(Throwables.BiConsumer<? super T,? super Exception,E> action)
Gets the then accept.
|
<E extends Exception> |
getThenAccept(Throwables.Consumer<? super T,E> action)
Gets the then accept.
|
<U,E extends Exception> |
getThenApply(long timeout,
TimeUnit unit,
Throwables.BiFunction<? super T,? super Exception,U,E> action)
Gets the then apply.
|
<U,E extends Exception> |
getThenApply(long timeout,
TimeUnit unit,
Throwables.Function<? super T,U,E> action)
Gets the then apply.
|
<U,E extends Exception> |
getThenApply(Throwables.BiFunction<? super T,? super Exception,U,E> action)
Gets the then apply.
|
<U,E extends Exception> |
getThenApply(Throwables.Function<? super T,U,E> action)
Gets the then apply.
|
boolean |
isAllCancelled()
Returns true if this future and all previous stage futures have been recursively cancelled, otherwise false is returned.
|
boolean |
isCancelled()
Checks if is cancelled.
|
boolean |
isDone()
Checks if is done.
|
<U,E extends Exception> |
map(Throwables.Function<? super T,U,E> func) |
static <E extends Exception> |
run(Throwables.Runnable<E> action) |
static <E extends Exception> |
run(Throwables.Runnable<E> action,
Executor executor) |
<E extends Exception> |
runAfterBoth(ContinuableFuture<?> other,
Throwables.Runnable<E> action)
Run after both.
|
<U,E extends Exception> |
runAfterBoth(ContinuableFuture<U> other,
Throwables.BiConsumer<? super T,? super U,E> action)
Run after both.
|
<U,E extends Exception> |
runAfterBoth(ContinuableFuture<U> other,
Throwables.Consumer<? super Tuple.Tuple4<T,? super Exception,U,? super Exception>,E> action)
Run after both.
|
<U,E extends Exception> |
runAfterBoth(ContinuableFuture<U> other,
Throwables.QuadConsumer<T,? super Exception,U,? super Exception,E> action)
Run after both.
|
<E extends Exception> |
runAfterEither(ContinuableFuture<?> other,
Throwables.Runnable<E> action)
Run after either.
|
<E extends Exception> |
runAfterEither(ContinuableFuture<? extends T> other,
Throwables.BiConsumer<? super T,? super Exception,E> action)
Run after either.
|
<E extends Exception> |
runAfterEither(ContinuableFuture<? extends T> other,
Throwables.Consumer<? super T,E> action)
Run after either.
|
<R> ContinuableFuture<R> |
thenCall(Callable<R> action) |
<R,E extends Exception> |
thenCall(Throwables.BiFunction<? super T,? super Exception,R,E> action) |
<R,E extends Exception> |
thenCall(Throwables.Function<? super T,R,E> action) |
ContinuableFuture<T> |
thenDelay(long delay,
TimeUnit unit) |
<E extends Exception> |
thenRun(Throwables.BiConsumer<? super T,? super Exception,E> action) |
<E extends Exception> |
thenRun(Throwables.Consumer<? super T,E> action) |
<E extends Exception> |
thenRun(Throwables.Runnable<E> action) |
ContinuableFuture<T> |
thenUse(Executor executor) |
static <T> ContinuableFuture<T> |
wrap(Future<T> future) |
public static <E extends Exception> ContinuableFuture<Void> run(Throwables.Runnable<E> action)
E - action - N.asyncExecute(com.landawn.abacus.util.Throwables.Runnable)public static <E extends Exception> ContinuableFuture<Void> run(Throwables.Runnable<E> action, Executor executor)
E - action - executor - public static <T> ContinuableFuture<T> call(Callable<T> action)
T - E - action - N.asyncExecute(Callable)public static <T> ContinuableFuture<T> call(Callable<T> action, Executor executor)
T - E - action - executor - public static <T> ContinuableFuture<T> completed(T result)
T - result - public static <T> ContinuableFuture<T> wrap(Future<T> future)
T - future - public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>public boolean cancelAll(boolean mayInterruptIfRunning)
mayInterruptIfRunning - public boolean isAllCancelled()
public boolean isDone()
public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedException - the interrupted exceptionExecutionException - the execution exceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>timeout - unit - InterruptedException - the interrupted exceptionExecutionException - the execution exceptionTimeoutException - the timeout exceptionpublic Result<T,Exception> gett(long timeout, TimeUnit unit)
timeout - unit - public <U,E extends Exception> U getThenApply(Throwables.Function<? super T,U,E> action) throws InterruptedException, ExecutionException, E extends Exception
U - E - action - InterruptedException - the interrupted exceptionExecutionException - the execution exceptionE - the eE extends Exceptionpublic <U,E extends Exception> U getThenApply(long timeout, TimeUnit unit, Throwables.Function<? super T,U,E> action) throws InterruptedException, ExecutionException, TimeoutException, E extends Exception
U - E - timeout - unit - action - InterruptedException - the interrupted exceptionExecutionException - the execution exceptionTimeoutException - the timeout exceptionE - the eE extends Exceptionpublic <U,E extends Exception> U getThenApply(Throwables.BiFunction<? super T,? super Exception,U,E> action) throws E extends Exception
U - E - action - E - the eE extends Exceptionpublic <U,E extends Exception> U getThenApply(long timeout, TimeUnit unit, Throwables.BiFunction<? super T,? super Exception,U,E> action) throws E extends Exception
U - E - timeout - unit - action - E - the eE extends Exceptionpublic <E extends Exception> void getThenAccept(Throwables.Consumer<? super T,E> action) throws InterruptedException, ExecutionException, E extends Exception
E - action - InterruptedException - the interrupted exceptionExecutionException - the execution exceptionE - the eE extends Exceptionpublic <E extends Exception> void getThenAccept(long timeout, TimeUnit unit, Throwables.Consumer<? super T,E> action) throws InterruptedException, ExecutionException, TimeoutException, E extends Exception
E - timeout - unit - action - InterruptedException - the interrupted exceptionExecutionException - the execution exceptionTimeoutException - the timeout exceptionE - the eE extends Exceptionpublic <E extends Exception> void getThenAccept(Throwables.BiConsumer<? super T,? super Exception,E> action) throws E extends Exception
E - action - E - the eE extends Exceptionpublic <E extends Exception> void getThenAccept(long timeout, TimeUnit unit, Throwables.BiConsumer<? super T,? super Exception,E> action) throws E extends Exception
E - timeout - unit - action - E - the eE extends Exceptionpublic <U,E extends Exception> ContinuableFuture<U> map(Throwables.Function<? super T,U,E> func)
U - E - func - public <E extends Exception> ContinuableFuture<Void> thenRun(Throwables.Runnable<E> action)
E - action - public <E extends Exception> ContinuableFuture<Void> thenRun(Throwables.Consumer<? super T,E> action)
E - action - public <E extends Exception> ContinuableFuture<Void> thenRun(Throwables.BiConsumer<? super T,? super Exception,E> action)
E - action - public <R> ContinuableFuture<R> thenCall(Callable<R> action)
R - E - action - public <R,E extends Exception> ContinuableFuture<R> thenCall(Throwables.Function<? super T,R,E> action)
R - E - action - public <R,E extends Exception> ContinuableFuture<R> thenCall(Throwables.BiFunction<? super T,? super Exception,R,E> action)
R - E - action - public <E extends Exception> ContinuableFuture<Void> runAfterBoth(ContinuableFuture<?> other, Throwables.Runnable<E> action)
E - other - action - public <U,E extends Exception> ContinuableFuture<Void> runAfterBoth(ContinuableFuture<U> other, Throwables.BiConsumer<? super T,? super U,E> action)
U - E - other - action - public <U,E extends Exception> ContinuableFuture<Void> runAfterBoth(ContinuableFuture<U> other, Throwables.Consumer<? super Tuple.Tuple4<T,? super Exception,U,? super Exception>,E> action)
U - E - other - action - public <U,E extends Exception> ContinuableFuture<Void> runAfterBoth(ContinuableFuture<U> other, Throwables.QuadConsumer<T,? super Exception,U,? super Exception,E> action)
U - E - other - action - public <R> ContinuableFuture<R> callAfterBoth(ContinuableFuture<?> other, Callable<R> action)
R - E - other - action - public <U,R,E extends Exception> ContinuableFuture<R> callAfterBoth(ContinuableFuture<U> other, Throwables.BiFunction<? super T,? super U,R,E> action)
U - R - E - other - action - public <U,R,E extends Exception> ContinuableFuture<R> callAfterBoth(ContinuableFuture<U> other, Throwables.Function<? super Tuple.Tuple4<T,? super Exception,U,? super Exception>,R,E> action)
U - R - E - other - action - public <U,R,E extends Exception> ContinuableFuture<R> callAfterBoth(ContinuableFuture<U> other, Throwables.QuadFunction<T,? super Exception,U,? super Exception,R,E> action)
U - R - E - other - action - public <E extends Exception> ContinuableFuture<Void> runAfterEither(ContinuableFuture<?> other, Throwables.Runnable<E> action)
E - other - action - public <E extends Exception> ContinuableFuture<Void> runAfterEither(ContinuableFuture<? extends T> other, Throwables.Consumer<? super T,E> action)
E - other - action - public <E extends Exception> ContinuableFuture<Void> runAfterEither(ContinuableFuture<? extends T> other, Throwables.BiConsumer<? super T,? super Exception,E> action)
E - other - action - public <R> ContinuableFuture<R> callAfterEither(ContinuableFuture<?> other, Callable<R> action)
R - E - other - action - public <R,E extends Exception> ContinuableFuture<R> callAfterEither(ContinuableFuture<? extends T> other, Throwables.Function<? super T,R,E> action)
R - E - other - action - public <R,E extends Exception> ContinuableFuture<R> callAfterEither(ContinuableFuture<? extends T> other, Throwables.BiFunction<? super T,? super Exception,R,E> action)
R - E - other - action - public ContinuableFuture<T> thenDelay(long delay, TimeUnit unit)
delay - unit - public ContinuableFuture<T> thenUse(Executor executor)
executor - Copyright © 2021. All rights reserved.