You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, client stream receives a request with type impl tonic::IntoStreamingRequest<Message=...>, it seems not expose a interface to manually fail this streaming. A real world user case is to use client streaming to send a file, each message represent a chunk of this file. It is possible that the source of file may meet error, e.g, read from a disk file meet IO errors, thus we may want to manually terminate the streaming with a fail status so the server side can know that this is not s successful call.
I saw the internal pat of the client streaming will also transfer this stream to Stream<Item=<Result<Message, tonic::Status>>> at:
thus, it is better to expose the Result to the input type? Why not directly the request type as impl tonic::IntoStreamingRequest<Message=Result<ReqType, tonic::Status>>?
The text was updated successfully, but these errors were encountered:
Currently, client stream receives a request with type
impl tonic::IntoStreamingRequest<Message=...>
, it seems not expose a interface to manually fail this streaming. A real world user case is to use client streaming to send a file, each message represent a chunk of this file. It is possible that the source of file may meet error, e.g, read from a disk file meet IO errors, thus we may want to manually terminate the streaming with a fail status so the server side can know that this is not s successful call.I saw the internal pat of the client streaming will also transfer this stream to
Stream<Item=<Result<Message, tonic::Status>>>
at:tonic/tonic/src/codec/encode.rs
Lines 38 to 54 in d312dcc
thus, it is better to expose the Result to the input type? Why not directly the request type as
impl tonic::IntoStreamingRequest<Message=Result<ReqType, tonic::Status>>
?The text was updated successfully, but these errors were encountered: