Package io.servicetalk.grpc.api
Interface GrpcRoutes.BlockingStreamingRoute<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.BlockingStreamingRoute<Req,Resp> extends GracefulAutoCloseable
A blocking gRPC route with bi-directional streaming.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()voidhandle(GrpcServiceContext ctx, BlockingIterable<Req> request, GrpcPayloadWriter<Resp> responseWriter)Handles the passedGrpcRoutes.BlockingStreamingRoute.static <Req,Resp>
GrpcRoutes.BlockingStreamingRoute<Req,Resp>wrap(GrpcRoutes.BlockingStreamingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)Convenience method to wrap a rawGrpcRoutes.BlockingStreamingRouteinstance with a passed detached close implementation ofGracefulAutoCloseable.-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
handle
void handle(GrpcServiceContext ctx, BlockingIterable<Req> request, GrpcPayloadWriter<Resp> responseWriter) throws java.lang.Exception
Handles the passedGrpcRoutes.BlockingStreamingRoute.- Parameters:
ctx-GrpcServiceContextfor this call.request-BlockingIterableofGrpcRoutes.BlockingStreamingRouteto handle.responseWriter-GrpcPayloadWriterto write 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.BlockingStreamingRoute<Req,Resp> wrap(GrpcRoutes.BlockingStreamingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)
Convenience method to wrap a rawGrpcRoutes.BlockingStreamingRouteinstance with a passed detached close implementation ofGracefulAutoCloseable.- Type Parameters:
Req- Type of request.Resp- Type of response.- Parameters:
rawRoute-GrpcRoutes.BlockingStreamingRouteinstance that has a detached close implementation.closeable-GracefulAutoCloseableimplementation for the passedrawRoute.- Returns:
- A new
GrpcRoutes.BlockingStreamingRoutethat attaches the passedcloseableto the passedrawRoute.
-
-