Inbound message stream handle for reading a sequence of messages from the peer.
Reader<Request> reads the stream of requests sent by the client.Reader<Response> reads the stream of responses sent by the server.Call Read() in a loop until the returned ReadFuture resolves to kEndOfStream, which indicates that the peer called Finish() (or dropped its Writer) and no more messages will arrive.
Destroying a Reader before the stream ends stops reading incoming messages (any unread or subsequent messages from the peer are discarded).
Writer or UnaryWriter.Cancel() does, since nothing is left to observe its outcome. This keeps the server from running an abandoned RPC, such as an unbounded server stream, until the connection closes.
Public Member Functions | |
| Reader (const Reader &)=delete | |
| Reader & | operator= (const Reader &)=delete |
| Reader (Reader &&) noexcept=default | |
| Reader & | operator= (Reader &&) noexcept=default |
| ReadFuture< Message > | Read () |
Public Member Functions inherited from pw::rpc2::internal::ReaderBase | |
| ReaderBase (const ReaderBase &)=delete | |
| ReaderBase & | operator= (const ReaderBase &)=delete |
| void | Cancel () |
Friends | |
| struct | internal::CallAccess |
Additional Inherited Members | |
Protected Member Functions inherited from pw::rpc2::internal::ReaderBase | |
| ReaderBase (ReaderBase &&) noexcept=default | |
| ReaderBase & | operator= (ReaderBase &&other) noexcept |
|
inline |
Returns a future that resolves to the next inbound message, or kEndOfStream once the peer has finished the stream.
Only one ReadFuture may be pending at a time; await or destroy the returned future before calling Read() again.