Go to the documentation of this file.
21 #ifndef GRPCPP_ALARM_H
22 #define GRPCPP_ALARM_H
69 Alarm(
Alarm&& rhs) noexcept : alarm_(rhs.alarm_) { rhs.alarm_ =
nullptr; }
80 #ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
85 void Set(
const T& deadline, std::function<
void(
bool)> f) {
100 template <
typename T>
101 void Set(
const T& deadline, std::function<
void(
bool)> f) {
118 void SetInternal(
gpr_timespec deadline, std::function<
void(
bool)> f);
125 #endif // GRPCPP_ALARM_H
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:38
Alarm & operator=(const Alarm &)=delete
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
Alarm(Alarm &&rhs) noexcept
Alarms are movable.
Definition: alarm.h:69
Alarm & operator=(Alarm &&rhs) noexcept
Definition: alarm.h:70
void Set(::grpc::CompletionQueue *cq, const T &deadline, void *tag)
Trigger an alarm instance on completion queue cq at the specified time.
Definition: alarm.h:60
void Cancel()
Cancel a completion queue alarm.
Alarm()
Create an unset completion queue alarm.
NOTE: class experimental_type is not part of the public API of this class TODO(vjpai): Move these con...
Definition: alarm.h:93
experimental_type experimental()
NOTE: The function experimental() is not stable public API.
Definition: alarm.h:113
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
experimental_type(Alarm *alarm)
Definition: alarm.h:95
~Alarm() override
Destroy the given completion queue alarm, cancelling it in the process.
A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....
Definition: completion_queue.h:102
void Set(const T &deadline, std::function< void(bool)> f)
Set an alarm to invoke callback f.
Definition: alarm.h:101
Analogous to struct timespec.
Definition: gpr_types.h:47
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40
Alarm(::grpc::CompletionQueue *cq, const T &deadline, void *tag)
DEPRECATED: Create and set a completion queue alarm instance associated to cq.
Definition: alarm.h:51