Skip to content

Commit

Permalink
Adapt to vertx-core changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Mar 28, 2023
1 parent af1a9dd commit 1a8ca80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ public VertxServer start(Handler<AsyncResult<Void>> completionHandler) {

@Override
public VertxServer shutdown() {
return shutdown(ar -> {});
return shutdown(Promise.promise());
}

public VertxServer shutdown(Handler<AsyncResult<Void>> completionHandler) {
public VertxServer shutdown(Promise<Void> completionHandler) {
if (hook != null) {
context.removeCloseHook(hook);
}
Expand Down
4 changes: 3 additions & 1 deletion vertx-grpc/src/test/java/io/vertx/ext/grpc/GrpcTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ public void tearDown(TestContext should) {
VertxServer s = server;
server = null;
final long timerId = rule.vertx().setTimer(10_000L, t -> should.fail("Timeout shutting down"));
s.shutdown(shutdown -> {
Promise<Void> promise = Promise.promise();
promise.future().onComplete(shutdown -> {
rule.vertx().cancelTimer(timerId);
if (shutdown.failed()) {
should.fail(shutdown.cause());
} else {
test.complete();
}
});
s.shutdown(promise);
}
}

Expand Down

0 comments on commit 1a8ca80

Please sign in to comment.