asio-grpc v1.6.0
Asynchronous gRPC with Asio/unified executors
|
Function object to wait for timers. More...
#include <agrpc/wait.hpp>
Public Member Functions | |
template<class Deadline , class CompletionToken = agrpc::DefaultCompletionToken> | |
auto | operator() (grpc::Alarm &alarm, const Deadline &deadline, CompletionToken &&token={}) const noexcept(detail::IS_NOTRHOW_GRPC_INITIATE_COMPLETION_TOKEN< CompletionToken > &&std::is_nothrow_copy_constructible_v< Deadline >) |
Wait for a grpc::Alarm More... | |
Function object to wait for timers.
Per-Operation Cancellation
All. Effectively calls grpc::Alarm::Cancel which will cause the operation to complete with false
.
|
inlinenoexcept |
Wait for a grpc::Alarm
The operation finishes once the alarm expires (at deadline) or is cancelled (see Cancel). If the alarm expired, the result will be true, false otherwise (ie, upon cancellation).
Example:
deadline | By default gRPC supports two types of deadlines: gpr_timespec and std::chrono::system_clock::time_point . More types can be added by specializing grpc::TimePoint. |
token | A completion token like asio::yield_context or the one created by agrpc::use_sender . The completion signature is void(bool) . true if it expired, false if it was canceled. |