asio-grpc v1.4.0
Asynchronous gRPC with Asio/unified executors
|
Server-side function object to coalesce write and finish of streaming RPCs. More...
#include <agrpc/rpc.hpp>
Public Member Functions | |
template<class Response , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncWriter< Response > &writer, const Response &response, grpc::WriteOptions options, const grpc::Status &status, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Coalesce write and finish of a server stream. More... | |
template<class Response , class Request , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncReaderWriter< Response, Request > &reader_writer, const Response &response, grpc::WriteOptions options, const grpc::Status &status, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Coalesce write and finish of a bidirectional stream. More... | |
Server-side function object to coalesce write and finish of streaming RPCs.
The examples below are based on the following .proto file:
|
inlinenoexcept |
Coalesce write and finish of a bidirectional stream.
Write response and coalesce it with trailing metadata which contains status, using WriteOptions options.
write_and_finish is equivalent of performing write_last and finish in a single step.
gRPC does not take ownership or a reference to response and status, so it is safe to deallocate once write_and_finish returns.
Implicit input parameter:
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true means that the data/metadata/status/etc is going to go to the wire. If it is false , it is not going to the wire because the call is already dead (i.e., canceled, deadline expired, other side dropped the channel, etc). |
|
inlinenoexcept |
Coalesce write and finish of a server stream.
Write response and coalesce it with trailing metadata which contains status, using WriteOptions options.
write_and_finish is equivalent of performing write_last and finish in a single step.
gRPC does not take ownership or a reference to response and status, so it is safe to deallocate once write_and_finish returns.
Implicit input parameter:
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true means that the data/metadata/status/etc is going to go to the wire. If it is false , it is not going to the wire because the call is already dead (i.e., canceled, deadline expired, other side dropped the channel, etc). |