asio-grpc v1.4.0
Asynchronous gRPC with Asio/unified executors
|
Client and server-side function object to read from streaming RPCs. More...
#include <agrpc/rpc.hpp>
Public Member Functions | |
template<class Response , class Request , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncReader< Response, Request > &reader, Request &request, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Read from a client stream. More... | |
template<class Response , class Request , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncReaderWriter< Response, Request > &reader_writer, Request &request, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Read from a bidirectional server stream. More... | |
template<class Response , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ClientAsyncReader< Response > &reader, Response &response, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Read from a server stream. More... | |
template<class Request , class Response , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ClientAsyncReaderWriter< Request, Response > &reader_writer, Response &response, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Read from a bidirectional client stream. More... | |
Client and server-side function object to read from streaming RPCs.
The examples below are based on the following .proto file:
|
inlinenoexcept |
Read from a server stream.
It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another read on the same stream since reads on the same stream are delivered in order.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true indicates that a valid message was read, false when the call is dead. |
|
inlinenoexcept |
Read from a bidirectional client stream.
This is thread-safe with respect to write or writes_done methods. It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another read on the same stream since reads on the same stream are delivered in order.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true indicates that a valid message was read, false when the call is dead. |
|
inlinenoexcept |
Read from a client stream.
It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another read on the same stream since reads on the same stream are delivered in order.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true indicates that a valid message was read. If not, you know that there are certainly no more messages that can ever be read from this stream. This could happen because the client has done a WritesDone already. |
|
inlinenoexcept |
Read from a bidirectional server stream.
This is thread-safe with respect to write or writes_done methods on the same stream. It should not be called concurrently with another read on the same stream as the order of delivery will not be defined.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true indicates that a valid message was read. false when there will be no more incoming messages, either because the other side has called WritesDone() or the stream has failed (or been cancelled). |