Req
- Type of request.Resp
- Type of response.@FunctionalInterface protected static interface GrpcRoutes.BlockingRoute<Req,Resp> extends GracefulAutoCloseable
Modifier and Type | Method and Description |
---|---|
default void |
close() |
Resp |
handle(GrpcServiceContext ctx,
Req request)
Handles the passed
Req . |
static <Req,Resp> GrpcRoutes.BlockingRoute<Req,Resp> |
wrap(GrpcRoutes.BlockingRoute<Req,Resp> rawRoute,
GracefulAutoCloseable closeable)
Convenience method to wrap a raw
GrpcRoutes.BlockingRoute instance with a passed detached close
implementation of GracefulAutoCloseable . |
closeGracefully
Resp handle(GrpcServiceContext ctx, Req request) throws java.lang.Exception
Req
.ctx
- GrpcServiceContext
for this call.request
- Req
to handle.java.lang.Exception
- If an exception occurs during request processing.default void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
static <Req,Resp> GrpcRoutes.BlockingRoute<Req,Resp> wrap(GrpcRoutes.BlockingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)
GrpcRoutes.BlockingRoute
instance with a passed detached close
implementation of GracefulAutoCloseable
.Req
- Type of request.Resp
- Type of response.rawRoute
- GrpcRoutes.BlockingRoute
instance that has a detached close implementation.closeable
- GracefulAutoCloseable
implementation for the passed rawRoute
.GrpcRoutes.BlockingRoute
that attaches the passed closeable
to the passed
rawRoute
.