Package io.servicetalk.grpc.api
Interface GrpcRoutes.Route<Req,Resp>
-
- Type Parameters:
Req- Type of request.Resp- Type of response.
- All Superinterfaces:
AsyncCloseable
- 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.Route<Req,Resp> extends AsyncCloseable
An asynchronous gRPC route.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CompletablecloseAsync()Used to close/shutdown a resource.Single<Resp>handle(GrpcServiceContext ctx, Req request)Handles the passedGrpcRoutes.Route.static <Req,Resp>
GrpcRoutes.Route<Req,Resp>wrap(GrpcRoutes.Route<Req,Resp> rawRoute, AsyncCloseable closeable)Convenience method to wrap a rawGrpcRoutes.Routeinstance with a passed detached close implementation ofAsyncCloseable.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
-
-
-
-
Method Detail
-
handle
Single<Resp> handle(GrpcServiceContext ctx, Req request)
Handles the passedGrpcRoutes.Route.- Parameters:
ctx-GrpcServiceContextfor this call.request-GrpcRoutes.Routeto handle.- Returns:
Singlecontaining the response.
-
closeAsync
default Completable closeAsync()
Description copied from interface:AsyncCloseableUsed to close/shutdown a resource.- Specified by:
closeAsyncin interfaceAsyncCloseable- Returns:
- A
Completablethat is notified once the close is complete.
-
wrap
static <Req,Resp> GrpcRoutes.Route<Req,Resp> wrap(GrpcRoutes.Route<Req,Resp> rawRoute, AsyncCloseable closeable)
Convenience method to wrap a rawGrpcRoutes.Routeinstance with a passed detached close implementation ofAsyncCloseable.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
rawRoute-GrpcRoutes.Routeinstance that has a detached close implementation.closeable-AsyncCloseableimplementation for the passedrawRoute.- Returns:
- A new
GrpcRoutes.Routethat attaches the passedcloseableto the passedrawRoute.
-
-