Description
One of the possible ways how to integrate with gRPC is to write a generic handler that reads http request's body (httpContext.Request.Body
) and parses them into grpc request messages and writes grpc response messages into httpContext.Response.Body
. This works pretty well (see prototype in https://github.com/jtattermusch/grpc-aspnetcore-experiments), but both request body and response body are instances of System.IO.Stream
, which works but isn't particularly efficient (e.g. copying of the data is required, it's hard to use with memory pooling etc.) and will probably become a performance bottleneck in the future.
Is there a way to access request and response bodies e.g. in terms of the new System.IO.Pipelines API?
Context: grpc/grpc#15139