Skip to content

Commit

Permalink
Using stop(Promise) instead
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 30, 2023
1 parent fd29e13 commit 91b6a2c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.jboss.logging.Logger;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;

/**
* A Vert.x {@link io.vertx.core.Verticle} that starts and stops a JCA {@link ResourceAdapter}.
Expand Down Expand Up @@ -41,10 +42,12 @@ public void start() throws Exception {
}

@Override
public void stop() {
public void stop(Promise<Void> stopPromise) {
if (workManager != null) {
workManager.close().result();
workManager.close().andThen((v) -> ra.stop()).andThen(stopPromise);
} else {
ra.stop();
stopPromise.complete();
}
ra.stop();
}
}

0 comments on commit 91b6a2c

Please sign in to comment.