asio-grpc v1.6.0
Asynchronous gRPC with Asio/unified executors
|
Server-side function object to finish RPCs with an error. More...
#include <agrpc/rpc.hpp>
Public Member Functions | |
template<class Response , class Request , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncReader< Response, Request > &reader, const grpc::Status &status, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Finish a client stream with an error. More... | |
template<class Response , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::ServerAsyncResponseWriter< Response > &writer, const grpc::Status &status, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken >) |
Finish a unary RPC with an error. More... | |
Server-side function object to finish RPCs with an error.
The examples below are based on the following .proto file:
Per-Operation Cancellation
None. Operations will be cancelled when the deadline of the RPC has been reached (see grpc::ClientContext::set_deadline) or the call has been cancelled (see grpc::ClientContext::TryCancel and grpc::ServerContext::TryCancel).
|
inlinenoexcept |
Finish a client stream with an error.
It should not be called concurrently with other streaming APIs on the same stream.
Side effect:
gRPC does not take ownership or a reference to status, so it is safe to deallocate once finish_with_error returns.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . The bool should always be true . |
|
inlinenoexcept |
Finish a unary RPC with an error.
Indicate that the stream is to be finished with a non-OK status, and request notification for when the server has finished sending the appropriate signals to the client to end the call.
Should not be used concurrently with other operations.
Side effect:
gRPC does not take ownership or a reference to status, so it is safe to deallocate once finish_with_error returns.
Example:
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . The bool should always be true . |