diff --git a/vertx-grpc/src/main/java/io/vertx/grpc/BlockingServerInterceptor.java b/vertx-grpc/src/main/java/io/vertx/grpc/BlockingServerInterceptor.java index b9c62283..d5659e59 100644 --- a/vertx-grpc/src/main/java/io/vertx/grpc/BlockingServerInterceptor.java +++ b/vertx-grpc/src/main/java/io/vertx/grpc/BlockingServerInterceptor.java @@ -47,8 +47,7 @@ private BlockingServerInterceptor(Vertx vertx, ServerInterceptor interceptor) { public ServerCall.Listener interceptCall(ServerCall serverCall, Metadata metadata, ServerCallHandler serverCallHandler) { AsyncListener asyncListener = new AsyncListener<>(); - vertx.>executeBlocking(blockingCode -> - blockingCode.complete(interceptor.interceptCall(serverCall, metadata, serverCallHandler)), + vertx.executeBlocking(() -> interceptor.interceptCall(serverCall, metadata, serverCallHandler), false).onComplete( ar -> { if (ar.succeeded()) { diff --git a/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java b/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java index 95b11a64..837a169c 100644 --- a/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java +++ b/vertx-grpc/src/main/java/io/vertx/grpc/VertxServer.java @@ -115,13 +115,9 @@ void start(ContextInternal context, Handler> completionHandler group.addWorker(context.nettyEventLoop()); contextLocal.get().add(context); if (start) { - context.executeBlocking(v2 -> { - try { - server.start(); - v2.complete(); - } catch (IOException e) { - v2.fail(e); - } + context.executeBlocking(() -> { + server.start(); + return null; }).onComplete(completionHandler); } else { completionHandler.handle(Future.succeededFuture()); @@ -136,9 +132,9 @@ void stop(ContextInternal context, Promise promise) { contextLocal.get().remove(context); if (shutdown) { map.remove(id); - context.executeBlocking(p -> { + context.executeBlocking(() -> { server.shutdown(); - p.complete(); + return null; }).onComplete(promise); } else { promise.complete();