Package io.servicetalk.grpc.api
Interface GrpcRoutes.StreamingRoute<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.StreamingRoute<Req,Resp>
extends AsyncCloseable
An asynchronous gRPC route with bi-directional streaming.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableUsed to close/shutdown a resource.handle(GrpcServiceContext ctx, Publisher<Req> request) Handles the passedGrpcRoutes.StreamingRoute.static <Req,Resp> GrpcRoutes.StreamingRoute<Req, Resp> wrap(GrpcRoutes.StreamingRoute<Req, Resp> rawRoute, AsyncCloseable closeable) Convenience method to wrap a rawGrpcRoutes.StreamingRouteinstance with a passed detached close implementation ofAsyncCloseable.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
-
Method Details
-
handle
Handles the passedGrpcRoutes.StreamingRoute.- Parameters:
ctx-GrpcServiceContextfor this call.request-PublisherofGrpcRoutes.StreamingRouteto handle.- Returns:
Singlecontaining the response.
-
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.StreamingRoute<Req,Resp> wrap(GrpcRoutes.StreamingRoute<Req, Resp> rawRoute, AsyncCloseable closeable) Convenience method to wrap a rawGrpcRoutes.StreamingRouteinstance with a passed detached close implementation ofAsyncCloseable.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
rawRoute-GrpcRoutes.StreamingRouteinstance that has a detached close implementation.closeable-AsyncCloseableimplementation for the passedrawRoute.- Returns:
- A new
GrpcRoutes.StreamingRoutethat attaches the passedcloseableto the passedrawRoute.
-