Req - Type of request.Resp - Type of response.@FunctionalInterface
protected static interface GrpcRoutes.BlockingResponseStreamingRoute<Req,Resp>
extends GracefulAutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
default void |
handle(GrpcServiceContext ctx,
Req request,
BlockingStreamingGrpcServerResponse<Resp> response)
Handles the passed
Req. |
void |
handle(GrpcServiceContext ctx,
Req request,
GrpcPayloadWriter<Resp> responseWriter)
Deprecated.
Use
handle(GrpcServiceContext, Object, BlockingStreamingGrpcServerResponse).
In the next release, this method will have a default implementation but the new overload won't. To avoid
breaking API changes, make sure to implement both methods. The release after next will remove this method.
This intermediate step is necessary to maintain FunctionalInterface contract that requires to have a
single non-default method.
Note: if you also use wrap(
GrpcRoutes.BlockingResponseStreamingRoute, GracefulAutoCloseable) method, make sure to pass there an
implementation of GrpcRoutes.BlockingResponseStreamingRoute that implements both overloads instead of a lambda.
Otherwise, the default handle(GrpcServiceContext, Object, BlockingStreamingGrpcServerResponse)
implementation will be used. |
static <Req,Resp> GrpcRoutes.BlockingResponseStreamingRoute<Req,Resp> |
wrap(GrpcRoutes.BlockingResponseStreamingRoute<Req,Resp> rawRoute,
GracefulAutoCloseable closeable)
Convenience method to wrap a raw
GrpcRoutes.BlockingResponseStreamingRoute instance with a passed detached close
implementation of GracefulAutoCloseable. |
@Deprecated void handle(GrpcServiceContext ctx, Req request, GrpcPayloadWriter<Resp> responseWriter) throws Exception
handle(GrpcServiceContext, Object, BlockingStreamingGrpcServerResponse).
In the next release, this method will have a default implementation but the new overload won't. To avoid
breaking API changes, make sure to implement both methods. The release after next will remove this method.
This intermediate step is necessary to maintain FunctionalInterface contract that requires to have a
single non-default method.
Note: if you also use wrap(
GrpcRoutes.BlockingResponseStreamingRoute, GracefulAutoCloseable) method, make sure to pass there an
implementation of GrpcRoutes.BlockingResponseStreamingRoute that implements both overloads instead of a lambda.
Otherwise, the default handle(GrpcServiceContext, Object, BlockingStreamingGrpcServerResponse)
implementation will be used.Req.ctx - GrpcServiceContext for this call.request - Req to handle.responseWriter - GrpcPayloadWriter to write the response.
The implementation of this method is responsible for calling Closeable.close().Exception - If an exception occurs during request processing.default void handle(GrpcServiceContext ctx, Req request, BlockingStreamingGrpcServerResponse<Resp> response) throws Exception
Req.ctx - GrpcServiceContext for this call.request - Req to handle.response - BlockingStreamingGrpcServerResponse to send the response.
The implementation of this method is responsible for calling Closeable.close().Exception - If an exception occurs during request processing.default void close()
throws Exception
close in interface AutoCloseableExceptionstatic <Req,Resp> GrpcRoutes.BlockingResponseStreamingRoute<Req,Resp> wrap(GrpcRoutes.BlockingResponseStreamingRoute<Req,Resp> rawRoute, GracefulAutoCloseable closeable)
GrpcRoutes.BlockingResponseStreamingRoute instance with a passed detached close
implementation of GracefulAutoCloseable.
Note: make sure to pass there an implementation of GrpcRoutes.BlockingResponseStreamingRoute that
implements both overloads instead of a lambda. Otherwise, the default
handle(GrpcServiceContext, Object, BlockingStreamingGrpcServerResponse) implementation will be used.
Req - Type of request.Resp - Type of response.rawRoute - GrpcRoutes.BlockingResponseStreamingRoute instance that has a detached close implementation.closeable - GracefulAutoCloseable implementation for the passed rawRoute.GrpcRoutes.BlockingResponseStreamingRoute that attaches the passed closeable to the passed
rawRoute.