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 void
close()
void
handle(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.BlockingStreamingRoute
instance 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
-GrpcServiceContext
for this call.request
-BlockingIterable
ofGrpcRoutes.BlockingStreamingRoute
to handle.responseWriter
-GrpcPayloadWriter
to write the response.- Throws:
java.lang.Exception
- If an exception occurs during request processing.
-
close
default void close() throws java.lang.Exception
- Specified by:
close
in 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.BlockingStreamingRoute
instance with a passed detached close implementation ofGracefulAutoCloseable
.- Type Parameters:
Req
- Type of request.Resp
- Type of response.- Parameters:
rawRoute
-GrpcRoutes.BlockingStreamingRoute
instance that has a detached close implementation.closeable
-GracefulAutoCloseable
implementation for the passedrawRoute
.- Returns:
- A new
GrpcRoutes.BlockingStreamingRoute
that attaches the passedcloseable
to the passedrawRoute
.
-
-