Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

=core Remove deperecated usages of CompositeFuture. #4729

Merged
merged 1 commit into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/io/vertx/core/eventbus/impl/EventBusImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ public <T> void sendOrPubInternal(MessageImpl message, DeliveryOptions options,

private Future<Void> unregisterAll() {
// Unregister all handlers explicitly - don't rely on context hooks
List<Future> futures = new ArrayList<>();
List<Future<?>> futures = new ArrayList<>();
for (ConcurrentCyclicSequence<HandlerHolder> handlers : handlerMap.values()) {
for (HandlerHolder holder : handlers) {
futures.add(holder.getHandler().unregister());
}
}
return CompositeFuture.join(futures).mapEmpty();
return Future.join(futures).mapEmpty();
}

private void addInterceptor(AtomicReferenceFieldUpdater<EventBusImpl, Handler[]> updater, Handler interceptor) {
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/io/vertx/core/impl/DeploymentManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package io.vertx.core.impl;

import io.vertx.core.AsyncResult;
import io.vertx.core.CompositeFuture;
import io.vertx.core.Context;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Future;
Expand Down Expand Up @@ -101,7 +100,7 @@ public Future<Void> undeployAll() {
deploymentIDs.add(entry.getKey());
}
}
List<Future> completionList = new ArrayList<>();
List<Future<?>> completionList = new ArrayList<>();
if (!deploymentIDs.isEmpty()) {
for (String deploymentID : deploymentIDs) {
Promise<Void> promise = Promise.promise();
Expand All @@ -115,7 +114,7 @@ public Future<Void> undeployAll() {
});
}
Promise<Void> promise = vertx.getOrCreateContext().promise();
CompositeFuture.join(completionList).<Void>mapEmpty().onComplete(promise);
Future.join(completionList).<Void>mapEmpty().onComplete(promise);
return promise.future();
} else {
return vertx.getOrCreateContext().succeededFuture();
Expand Down Expand Up @@ -302,16 +301,16 @@ private synchronized void rollback(ContextInternal callingContext, Handler<Async

private synchronized Future<Void> doUndeployChildren(ContextInternal undeployingContext) {
if (!children.isEmpty()) {
List<Future> childFuts = new ArrayList<>();
List<Future<?>> undeployFutures = new ArrayList<>();
for (Deployment childDeployment: new HashSet<>(children)) {
Promise<Void> p = Promise.promise();
childFuts.add(p.future());
undeployFutures.add(p.future());
childDeployment.doUndeploy(undeployingContext).onComplete(ar -> {
children.remove(childDeployment);
p.handle(ar);
});
}
return CompositeFuture.all(childFuts).mapEmpty();
return Future.all(undeployFutures).mapEmpty();
} else {
return Future.succeededFuture();
}
Expand All @@ -326,13 +325,13 @@ public synchronized Future<Void> doUndeploy(ContextInternal undeployingContext)
return doUndeployChildren(undeployingContext).compose(v -> doUndeploy(undeployingContext));
} else {
status = ST_UNDEPLOYED;
List<Future> undeployFutures = new ArrayList<>();
List<Future<?>> undeployFutures = new ArrayList<>();
if (parent != null) {
parent.removeChild(this);
}
for (VerticleHolder verticleHolder: verticles) {
ContextBase context = verticleHolder.context;
Promise p = Promise.promise();
Promise<?> p = Promise.promise();
undeployFutures.add(p.future());
context.runOnContext(v -> {
Promise<Void> stopPromise = undeployingContext.promise();
Expand Down Expand Up @@ -361,7 +360,7 @@ public synchronized Future<Void> doUndeploy(ContextInternal undeployingContext)
});
}
Promise<Void> resolvingPromise = undeployingContext.promise();
CompositeFuture.all(undeployFutures).<Void>mapEmpty().onComplete(resolvingPromise);
Future.all(undeployFutures).<Void>mapEmpty().onComplete(resolvingPromise);
Future<Void> fut = resolvingPromise.future();
Handler<Void> handler = undeployHandler;
if (handler != null) {
Expand Down