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