asio-grpc v3.4.0
Asynchronous gRPC with Asio/unified executors
|
#include <agrpc/detail/server_rpc_base.hpp>
Public Types | |
using | executor_type = Executor |
The executor type. | |
Public Member Functions | |
template<class CompletionToken = detail::DefaultCompletionTokenT<Executor>> | |
auto | send_initial_metadata (CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
Send initial metadata. | |
bool | is_done () const noexcept |
Is this rpc done? | |
auto | wait_for_done (CompletionToken &&token=detail::DefaultCompletionTokenT< Executor >{}) |
Wait for done. | |
const executor_type & | get_executor () const noexcept |
Get the executor. | |
const executor_type & | get_scheduler () const noexcept |
Get the scheduler. | |
auto & | context () |
Get the underlying ServerContext | |
const auto & | context () const |
Get the underlying ServerContext (const overload) | |
void | cancel () noexcept |
Cancel this RPC. | |
ServerRPC base.
|
inline |
Send initial metadata.
Request notification of the sending of initial metadata to the client.
This call is optional, but if it is used, it cannot be used concurrently with or after the finish()
/finish_with_error()
method.
token | A completion token like asio::yield_context or 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). |
|
inlinenodiscardnoexceptinherited |
Is this rpc done?
Only available if Traits
contain NOTIFY_WHEN_DONE = true
.
Returns true if NotifyWhenDone has fired which indicates that finish()
has been called or that the rpc is dead (i.e., canceled, deadline expired, other side dropped the channel, etc).
Thread-safe
|
inlineinherited |
Wait for done.
Only available if Traits
contain NOTIFY_WHEN_DONE = true
.
Request notification of the completion of this rpc, either due to calling finish()
or because the rpc is dead (i.e., canceled, deadline expired, other side dropped the channel, etc). rpc.context().IsCancelled() may only be called after this operation completes.
Cancelling this operation does not invoke grpc::ServerContext::TryCancel.
Internally, this operation uses grpc::ServerContext::AsyncNotifyWhenDone.
wait_for_done()
may be outstanding at a time.token | A completion token like asio::yield_context or agrpc::use_sender . The completion signature is void() . |
|
inlinenodiscardnoexceptinherited |
Get the executor.
Thread-safe
|
inlinenodiscardnoexceptinherited |
Get the scheduler.
Thread-safe
|
inlinenoexceptinherited |