T
- the expected type of resultpublic class VertxCompletableFuture<T> extends CompletableFuture<T> implements CompletionStage<T>
CompletableFuture
for Vert.x. It differs in the
way to handle async calls:
* VertxCompletableFuture
are attached to a Vert.x Context
*
All operator methods returns VertxCompletableFuture
* async
method not passing an Executor
are executed on the attached
Context
* All non async method are executed on the current Thread (so
not necessary on the attached Context
The class also offer bridges methods with Vert.x Future
, and regular
CompletableFuture
.
CompletableFuture.AsynchronousCompletionTask
Constructor and Description |
---|
VertxCompletableFuture()
Creates a new
VertxCompletableFuture using the current
Context . |
VertxCompletableFuture(io.vertx.core.Context context)
Creates an instance of
VertxCompletableFuture , using the given
Context . |
VertxCompletableFuture(io.vertx.core.Vertx vertx)
Creates an instance of
VertxCompletableFuture , using the current
Vert.x context or create a new one. |
Modifier and Type | Method and Description |
---|---|
VertxCompletableFuture<Void> |
acceptEither(CompletionStage<? extends T> other,
Consumer<? super T> action) |
VertxCompletableFuture<Void> |
acceptEitherAsync(CompletionStage<? extends T> other,
Consumer<? super T> action) |
VertxCompletableFuture<Void> |
acceptEitherAsync(CompletionStage<? extends T> other,
Consumer<? super T> action,
Executor executor) |
static VertxCompletableFuture<Void> |
allOf(io.vertx.core.Context context,
CompletableFuture<?>... futures)
Returns a new CompletableFuture that is completed when all of the given
CompletableFutures complete.
|
static VertxCompletableFuture<Void> |
allOf(io.vertx.core.Vertx vertx,
CompletableFuture<?>... futures)
Returns a new CompletableFuture that is completed when all of the given
CompletableFutures complete.
|
static VertxCompletableFuture<Object> |
anyOf(io.vertx.core.Context context,
CompletableFuture<?>... futures)
Returns a new CompletableFuture that is completed when any of the given
CompletableFutures complete, with the same result.
|
static VertxCompletableFuture<Object> |
anyOf(io.vertx.core.Vertx vertx,
CompletableFuture<?>... futures)
Returns a new CompletableFuture that is completed when any of the given
CompletableFutures complete, with the same result.
|
<U> VertxCompletableFuture<U> |
applyToEither(CompletionStage<? extends T> other,
Function<? super T,U> fn) |
<U> VertxCompletableFuture<U> |
applyToEitherAsync(CompletionStage<? extends T> other,
Function<? super T,U> fn) |
<U> VertxCompletableFuture<U> |
applyToEitherAsync(CompletionStage<? extends T> other,
Function<? super T,U> fn,
Executor executor) |
io.vertx.core.Context |
context() |
static <T> VertxCompletableFuture<T> |
from(io.vertx.core.Context context,
CompletableFuture<T> future)
|
static <T> VertxCompletableFuture<T> |
from(io.vertx.core.Context context,
io.vertx.core.Future<T> future)
|
static <T> VertxCompletableFuture<T> |
from(io.vertx.core.Vertx vertx,
CompletableFuture<T> future)
|
static <T> VertxCompletableFuture<T> |
from(io.vertx.core.Vertx vertx,
io.vertx.core.Future<T> future)
|
<U> VertxCompletableFuture<U> |
handle(BiFunction<? super T,Throwable,? extends U> fn) |
<U> VertxCompletableFuture<U> |
handleAsync(BiFunction<? super T,Throwable,? extends U> fn) |
<U> VertxCompletableFuture<U> |
handleAsync(BiFunction<? super T,Throwable,? extends U> fn,
Executor executor) |
VertxCompletableFuture<Void> |
runAfterBoth(CompletionStage<?> other,
Runnable action) |
VertxCompletableFuture<Void> |
runAfterBothAsync(CompletionStage<?> other,
Runnable action) |
VertxCompletableFuture<Void> |
runAfterBothAsync(CompletionStage<?> other,
Runnable action,
Executor executor) |
VertxCompletableFuture<Void> |
runAfterEither(CompletionStage<?> other,
Runnable action) |
VertxCompletableFuture<Void> |
runAfterEitherAsync(CompletionStage<?> other,
Runnable action) |
VertxCompletableFuture<Void> |
runAfterEitherAsync(CompletionStage<?> other,
Runnable action,
Executor executor) |
static VertxCompletableFuture<Void> |
runAsync(io.vertx.core.Context context,
Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the current Vert.x
Context after it runs the given
action. |
static VertxCompletableFuture<Void> |
runAsync(io.vertx.core.Vertx vertx,
Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the current Vert.x
Context after it runs the given
action. |
static VertxCompletableFuture<Void> |
runBlockingAsync(io.vertx.core.Context context,
Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed by a
action running in the worker thread pool of Vert.x
This method is different from
CompletableFuture.runAsync(Runnable)
as it does not use a fork join executor, but the worker thread pool. |
static VertxCompletableFuture<Void> |
runBlockingAsync(io.vertx.core.Vertx vertx,
Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed by a
action running in the worker thread pool of Vert.x
This method is different from
CompletableFuture.runAsync(Runnable)
as it does not use a fork join executor, but the worker thread pool. |
static <T> VertxCompletableFuture<T> |
supplyAsync(io.vertx.core.Context context,
Supplier<T> supplier)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the current Vert.x
Context with the value obtained by
calling the given Supplier. |
static <T> VertxCompletableFuture<T> |
supplyAsync(io.vertx.core.Vertx vertx,
Supplier<T> supplier)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the current Vert.x
Context with the value obtained by
calling the given Supplier. |
static <T> VertxCompletableFuture<T> |
supplyBlockingAsync(io.vertx.core.Context context,
Supplier<T> supplier)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the worker thread pool of Vert.x
This method is different from
CompletableFuture.supplyAsync(Supplier) as it does not use a fork
join executor, but the worker thread pool. |
static <T> VertxCompletableFuture<T> |
supplyBlockingAsync(io.vertx.core.Vertx vertx,
Supplier<T> supplier)
Returns a new CompletableFuture that is asynchronously completed by a task
running in the worker thread pool of Vert.x
This method is different from
CompletableFuture.supplyAsync(Supplier) as it does not use a fork
join executor, but the worker thread pool. |
VertxCompletableFuture<Void> |
thenAccept(Consumer<? super T> action) |
VertxCompletableFuture<Void> |
thenAcceptAsync(Consumer<? super T> action) |
VertxCompletableFuture<Void> |
thenAcceptAsync(Consumer<? super T> action,
Executor executor) |
<U> VertxCompletableFuture<Void> |
thenAcceptBoth(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action) |
<U> VertxCompletableFuture<Void> |
thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action) |
<U> VertxCompletableFuture<Void> |
thenAcceptBothAsync(CompletionStage<? extends U> other,
BiConsumer<? super T,? super U> action,
Executor executor) |
<U> VertxCompletableFuture<U> |
thenApply(Function<? super T,? extends U> fn) |
<U> VertxCompletableFuture<U> |
thenApplyAsync(Function<? super T,? extends U> fn) |
<U> VertxCompletableFuture<U> |
thenApplyAsync(Function<? super T,? extends U> fn,
Executor executor) |
<U,V> VertxCompletableFuture<V> |
thenCombine(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn) |
<U,V> VertxCompletableFuture<V> |
thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn) |
<U,V> VertxCompletableFuture<V> |
thenCombineAsync(CompletionStage<? extends U> other,
BiFunction<? super T,? super U,? extends V> fn,
Executor executor) |
<U> VertxCompletableFuture<U> |
thenCompose(Function<? super T,? extends CompletionStage<U>> fn) |
<U> VertxCompletableFuture<U> |
thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn) |
<U> VertxCompletableFuture<U> |
thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn,
Executor executor) |
VertxCompletableFuture<Void> |
thenRun(Runnable action) |
VertxCompletableFuture<Void> |
thenRunAsync(Runnable action) |
VertxCompletableFuture<Void> |
thenRunAsync(Runnable action,
Executor executor) |
VertxCompletableFuture<T> |
toCompletableFuture() |
io.vertx.core.Future<T> |
toFuture()
Creates a new
Future object completed / failed when the current
VertxCompletableFuture is completed successfully or not. |
static <T> io.vertx.core.Future<T> |
toFuture(CompletableFuture<T> future)
|
VertxCompletableFuture<T> |
whenComplete(BiConsumer<? super T,? super Throwable> action) |
VertxCompletableFuture<T> |
whenCompleteAsync(BiConsumer<? super T,? super Throwable> action) |
VertxCompletableFuture<T> |
whenCompleteAsync(BiConsumer<? super T,? super Throwable> action,
Executor executor) |
VertxCompletableFuture<T> |
withContext()
Creates a new
VertxCompletableFuture using the current context. |
VertxCompletableFuture<T> |
withContext(io.vertx.core.Context context)
Creates a new
VertxCompletableFuture using the given context. |
VertxCompletableFuture<T> |
withContext(io.vertx.core.Vertx vertx)
Creates a new
VertxCompletableFuture using the current context or
creates a new one. |
allOf, anyOf, cancel, complete, completedFuture, completeExceptionally, exceptionally, get, get, getNow, getNumberOfDependents, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, runAsync, runAsync, supplyAsync, supplyAsync, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exceptionally
public VertxCompletableFuture()
VertxCompletableFuture
using the current
Context
. This method must be used from a Vert.x
thread, or fails.public VertxCompletableFuture(io.vertx.core.Context context)
VertxCompletableFuture
, using the given
Context
.context
- the contextpublic VertxCompletableFuture(io.vertx.core.Vertx vertx)
VertxCompletableFuture
, using the current
Vert.x context or create a new one.vertx
- the Vert.x instancepublic static VertxCompletableFuture<Void> allOf(io.vertx.core.Context context, CompletableFuture<?>... futures)
null
.
Among the applications of this method is to await completion of a set of
independent CompletableFutures before continuing a program, as in:
CompletableFuture.allOf(c1, c2, c3).join();
.
CompletableFuture.allOf(CompletableFuture[])
this method invokes the dependent stages into the Vert.x context.context
- the contextfutures
- the CompletableFuturesNullPointerException
- if the array or any of its elements are null
public static VertxCompletableFuture<Void> allOf(io.vertx.core.Vertx vertx, CompletableFuture<?>... futures)
null
.
Among the applications of this method is to await completion of a set of
independent CompletableFutures before continuing a program, as in:
CompletableFuture.allOf(c1, c2, c3).join();
.
CompletableFuture.allOf(CompletableFuture[])
this method invokes the dependent stages into the Vert.x context.vertx
- the Vert.x instance to retrieve the contextfutures
- the CompletableFuturesNullPointerException
- if the array or any of its elements are null
public static VertxCompletableFuture<Object> anyOf(io.vertx.core.Context context, CompletableFuture<?>... futures)
Unlike the original CompletableFuture.allOf(CompletableFuture[])
this method invokes the dependent stages into the Vert.x context.
context
- the contextfutures
- the CompletableFuturesNullPointerException
- if the array or any of its elements are null
public static VertxCompletableFuture<Object> anyOf(io.vertx.core.Vertx vertx, CompletableFuture<?>... futures)
Unlike the original CompletableFuture.allOf(CompletableFuture[])
this method invokes the dependent stages into the Vert.x context.
vertx
- the Vert.x instance to retrieve the contextfutures
- the CompletableFuturesNullPointerException
- if the array or any of its elements are null
public static <T> VertxCompletableFuture<T> from(io.vertx.core.Context context, CompletableFuture<T> future)
VertxCompletableFuture
from the given Context
and
CompletableFuture
.
The created VertxCompletableFuture
is completed successfully or not
when the given future completes successfully or not. The completion is
called on the given Context
, immediately if it is already executing
on the right context, asynchronously if not.
T
- the type of resultcontext
- the contextfuture
- the futureVertxCompletableFuture
public static <T> VertxCompletableFuture<T> from(io.vertx.core.Context context, io.vertx.core.Future<T> future)
VertxCompletableFuture
from the given Context
instance and given Future
. The returned future uses the current
Vert.x context, or creates a new one.
The created VertxCompletableFuture
is completed successfully or not
when the given future completes successfully or not. The created
VertxCompletableFuture
is completed successfully or not when the
given future completes successfully or not. The completion is called on the
given Context
, immediately if it is already executing on the right
context, asynchronously if not.
T
- the type of the resultcontext
- the contextfuture
- the Vert.x futureVertxCompletableFuture
public static <T> VertxCompletableFuture<T> from(io.vertx.core.Vertx vertx, CompletableFuture<T> future)
VertxCompletableFuture
from the given Vertx
instance and given CompletableFuture
. The returned future uses the
current Vert.x context, or creates a new one.
The created VertxCompletableFuture
is completed successfully or not
when the given completable future completes successfully or not.
T
- the type of the resultvertx
- the Vert.x instancefuture
- the futureVertxCompletableFuture
public static <T> VertxCompletableFuture<T> from(io.vertx.core.Vertx vertx, io.vertx.core.Future<T> future)
VertxCompletableFuture
from the given Context
instance and given Future
. The returned future uses the current
Vert.x context, or creates a new one.
The created VertxCompletableFuture
is completed successfully or not
when the given future completes successfully or not.
T
- the type of the resultvertx
- the Vert.x instancefuture
- the Vert.x futureVertxCompletableFuture
public static VertxCompletableFuture<Void> runAsync(io.vertx.core.Context context, Runnable runnable)
Context
after it runs the given
action.
This method is different from CompletableFuture.runAsync(Runnable)
as it does not use a fork join executor, but use the Vert.x context.
context
- the contextrunnable
- the action to run before completing the returned CompletableFuturepublic static VertxCompletableFuture<Void> runAsync(io.vertx.core.Vertx vertx, Runnable runnable)
Context
after it runs the given
action.
This method is different from
CompletableFuture.supplyAsync(Supplier)
as it does not use a fork
join executor, but use the Vert.x context.
vertx
- the Vert.x instancerunnable
- the action to run before completing the returned CompletableFuturepublic static VertxCompletableFuture<Void> runBlockingAsync(io.vertx.core.Context context, Runnable runnable)
This method is different from CompletableFuture.runAsync(Runnable)
as it does not use a fork join executor, but the worker thread pool.
context
- the Vert.x contextrunnable
- the action, when its execution completes, it completes the
returned CompletableFuture. If the execution throws an exception,
the returned CompletableFuture is completed exceptionally.public static VertxCompletableFuture<Void> runBlockingAsync(io.vertx.core.Vertx vertx, Runnable runnable)
This method is different from CompletableFuture.runAsync(Runnable)
as it does not use a fork join executor, but the worker thread pool.
vertx
- the Vert.x instancerunnable
- the action, when its execution completes, it completes the
returned CompletableFuture. If the execution throws an exception,
the returned CompletableFuture is completed exceptionally.public static <T> VertxCompletableFuture<T> supplyAsync(io.vertx.core.Context context, Supplier<T> supplier)
Context
with the value obtained by
calling the given Supplier.
This method is different from
CompletableFuture.supplyAsync(Supplier)
as it does not use a fork
join executor, but use the Vert.x context.
T
- the function's return typecontext
- the context in which the supplier is executed.supplier
- a function returning the value to be used to complete the returned
CompletableFuturepublic static <T> VertxCompletableFuture<T> supplyAsync(io.vertx.core.Vertx vertx, Supplier<T> supplier)
Context
with the value obtained by
calling the given Supplier.
This method is different from
CompletableFuture.supplyAsync(Supplier)
as it does not use a fork
join executor, but use the Vert.x context.
T
- the function's return typevertx
- the Vert.x instancesupplier
- a function returning the value to be used to complete the returned
CompletableFuturepublic static <T> VertxCompletableFuture<T> supplyBlockingAsync(io.vertx.core.Context context, Supplier<T> supplier)
This method is different from
CompletableFuture.supplyAsync(Supplier)
as it does not use a fork
join executor, but the worker thread pool.
T
- the function's return typecontext
- the context in which the supplier is executed.supplier
- a function returning the value to be used to complete the returned
CompletableFuturepublic static <T> VertxCompletableFuture<T> supplyBlockingAsync(io.vertx.core.Vertx vertx, Supplier<T> supplier)
This method is different from
CompletableFuture.supplyAsync(Supplier)
as it does not use a fork
join executor, but the worker thread pool.
T
- the function's return typevertx
- the Vert.x instancesupplier
- a function returning the value to be used to complete the returned
CompletableFuturepublic static <T> io.vertx.core.Future<T> toFuture(CompletableFuture<T> future)
T
- the type of the resultfuture
- the futureCompletableFuture
completes or fails.public VertxCompletableFuture<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action)
acceptEither
in interface CompletionStage<T>
acceptEither
in class CompletableFuture<T>
public VertxCompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action)
acceptEitherAsync
in interface CompletionStage<T>
acceptEitherAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
acceptEitherAsync
in interface CompletionStage<T>
acceptEitherAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T,U> fn)
applyToEither
in interface CompletionStage<T>
applyToEither
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn)
applyToEitherAsync
in interface CompletionStage<T>
applyToEitherAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn, Executor executor)
applyToEitherAsync
in interface CompletionStage<T>
applyToEitherAsync
in class CompletableFuture<T>
public io.vertx.core.Context context()
VertxCompletableFuture
.public <U> VertxCompletableFuture<U> handle(BiFunction<? super T,Throwable,? extends U> fn)
handle
in interface CompletionStage<T>
handle
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> handleAsync(BiFunction<? super T,Throwable,? extends U> fn)
handleAsync
in interface CompletionStage<T>
handleAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> handleAsync(BiFunction<? super T,Throwable,? extends U> fn, Executor executor)
handleAsync
in interface CompletionStage<T>
handleAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterBoth(CompletionStage<?> other, Runnable action)
runAfterBoth
in interface CompletionStage<T>
runAfterBoth
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action)
runAfterBothAsync
in interface CompletionStage<T>
runAfterBothAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor)
runAfterBothAsync
in interface CompletionStage<T>
runAfterBothAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterEither(CompletionStage<?> other, Runnable action)
runAfterEither
in interface CompletionStage<T>
runAfterEither
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action)
runAfterEitherAsync
in interface CompletionStage<T>
runAfterEitherAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor)
runAfterEitherAsync
in interface CompletionStage<T>
runAfterEitherAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenAccept(Consumer<? super T> action)
thenAccept
in interface CompletionStage<T>
thenAccept
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenAcceptAsync(Consumer<? super T> action)
thenAcceptAsync
in interface CompletionStage<T>
thenAcceptAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor)
thenAcceptAsync
in interface CompletionStage<T>
thenAcceptAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
thenAcceptBoth
in interface CompletionStage<T>
thenAcceptBoth
in class CompletableFuture<T>
public <U> VertxCompletableFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
thenAcceptBothAsync
in interface CompletionStage<T>
thenAcceptBothAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action, Executor executor)
thenAcceptBothAsync
in interface CompletionStage<T>
thenAcceptBothAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenApply(Function<? super T,? extends U> fn)
thenApply
in interface CompletionStage<T>
thenApply
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenApplyAsync(Function<? super T,? extends U> fn)
thenApplyAsync
in interface CompletionStage<T>
thenApplyAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenApplyAsync(Function<? super T,? extends U> fn, Executor executor)
thenApplyAsync
in interface CompletionStage<T>
thenApplyAsync
in class CompletableFuture<T>
public <U,V> VertxCompletableFuture<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
thenCombine
in interface CompletionStage<T>
thenCombine
in class CompletableFuture<T>
public <U,V> VertxCompletableFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
thenCombineAsync
in interface CompletionStage<T>
thenCombineAsync
in class CompletableFuture<T>
public <U,V> VertxCompletableFuture<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn, Executor executor)
thenCombineAsync
in interface CompletionStage<T>
thenCombineAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenCompose(Function<? super T,? extends CompletionStage<U>> fn)
thenCompose
in interface CompletionStage<T>
thenCompose
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn)
thenComposeAsync
in interface CompletionStage<T>
thenComposeAsync
in class CompletableFuture<T>
public <U> VertxCompletableFuture<U> thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn, Executor executor)
thenComposeAsync
in interface CompletionStage<T>
thenComposeAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenRun(Runnable action)
thenRun
in interface CompletionStage<T>
thenRun
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenRunAsync(Runnable action)
thenRunAsync
in interface CompletionStage<T>
thenRunAsync
in class CompletableFuture<T>
public VertxCompletableFuture<Void> thenRunAsync(Runnable action, Executor executor)
thenRunAsync
in interface CompletionStage<T>
thenRunAsync
in class CompletableFuture<T>
public VertxCompletableFuture<T> toCompletableFuture()
toCompletableFuture
in interface CompletionStage<T>
toCompletableFuture
in class CompletableFuture<T>
public io.vertx.core.Future<T> toFuture()
Future
object completed / failed when the current
VertxCompletableFuture
is completed successfully or not.Future
.public VertxCompletableFuture<T> whenComplete(BiConsumer<? super T,? super Throwable> action)
whenComplete
in interface CompletionStage<T>
whenComplete
in class CompletableFuture<T>
public VertxCompletableFuture<T> whenCompleteAsync(BiConsumer<? super T,? super Throwable> action)
whenCompleteAsync
in interface CompletionStage<T>
whenCompleteAsync
in class CompletableFuture<T>
public VertxCompletableFuture<T> whenCompleteAsync(BiConsumer<? super T,? super Throwable> action, Executor executor)
whenCompleteAsync
in interface CompletionStage<T>
whenCompleteAsync
in class CompletableFuture<T>
public VertxCompletableFuture<T> withContext()
VertxCompletableFuture
using the current context.
This method is used to switch between Vert.x contexts.VertxCompletableFuture
public VertxCompletableFuture<T> withContext(io.vertx.core.Context context)
VertxCompletableFuture
using the given context. This
method is used to switch between Vert.x contexts.context
- the contextpublic VertxCompletableFuture<T> withContext(io.vertx.core.Vertx vertx)
VertxCompletableFuture
using the current context or
creates a new one. This method is used to switch between Vert.x contexts.vertx
- the vertxCopyright © 2017 JSpare.org. All rights reserved.