Package io.servicetalk.grpc.api
Interface GrpcRoutes.BlockingRoute<Req,Resp>
-
- Type Parameters:
Req- Type of request.Resp- Type of response.
- All Superinterfaces:
java.lang.AutoCloseable,GracefulAutoCloseable
- Enclosing class:
- GrpcRoutes<Service extends GrpcService>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface protected static interface GrpcRoutes.BlockingRoute<Req,Resp> extends GracefulAutoCloseable
A blocking gRPC route.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Resphandle(GrpcServiceContext ctx, Req request)Handles the passedGrpcRoutes.BlockingRoute.static <Req,Resp>
GrpcRoutes.BlockingRoute<Req,Resp>wrap(GrpcRoutes.BlockingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)Convenience method to wrap a rawGrpcRoutes.BlockingRouteinstance with a passed detached close implementation ofGracefulAutoCloseable.-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
handle
Resp handle(GrpcServiceContext ctx, Req request) throws java.lang.Exception
Handles the passedGrpcRoutes.BlockingRoute.- Parameters:
ctx-GrpcServiceContextfor this call.request-GrpcRoutes.BlockingRouteto handle.- Returns:
- The response.
- Throws:
java.lang.Exception- If an exception occurs during request processing.
-
close
default void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
wrap
static <Req,Resp> GrpcRoutes.BlockingRoute<Req,Resp> wrap(GrpcRoutes.BlockingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)
Convenience method to wrap a rawGrpcRoutes.BlockingRouteinstance with a passed detached close implementation ofGracefulAutoCloseable.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
rawRoute-GrpcRoutes.BlockingRouteinstance that has a detached close implementation.closeable-GracefulAutoCloseableimplementation for the passedrawRoute.- Returns:
- A new
GrpcRoutes.BlockingRoutethat attaches the passedcloseableto the passedrawRoute.
-
-