Class BlockingServerInterceptor

java.lang.Object
io.quarkus.grpc.runtime.supports.blocking.BlockingServerInterceptor
All Implemented Interfaces:
io.grpc.ServerInterceptor, Function<String,Boolean>

public class BlockingServerInterceptor extends Object implements io.grpc.ServerInterceptor, Function<String,Boolean>
gRPC Server interceptor offloading the execution of the gRPC method on a worker thread if the method is annotated with Blocking.

For non-annotated methods, the interceptor acts as a pass-through.

  • Constructor Details

    • BlockingServerInterceptor

      public BlockingServerInterceptor(io.vertx.core.Vertx vertx, List<String> blockingMethods, List<String> virtualMethods, Executor virtualThreadExecutor, boolean devMode)
  • Method Details

    • apply

      public Boolean apply(String name)
      Specified by:
      apply in interface Function<String,Boolean>
    • applyVirtual

      public Boolean applyVirtual(String name)
    • interceptCall

      public <ReqT, RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
      Specified by:
      interceptCall in interface io.grpc.ServerInterceptor
    • isExecutable

      protected boolean isExecutable()
    • getRequestContext

      protected io.quarkus.arc.ManagedContext getRequestContext()