Go to the documentation of this file.
21 #ifndef GRPCPP_ALARM_H
22 #define GRPCPP_ALARM_H
84 Alarm(
Alarm&& rhs) noexcept : alarm_(rhs.alarm_) { rhs.alarm_ =
nullptr; }
86 std::swap(alarm_, rhs.alarm_);
98 void Set(
const T& deadline, std::function<
void(
bool)> f) {
104 void SetInternal(
gpr_timespec deadline, std::function<
void(
bool)> f);
111 #endif // GRPCPP_ALARM_H
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:84
Alarm & operator=(Alarm &&rhs) noexcept
Definition: alarm.h:85
void Cancel()
Cancel a completion queue alarm.
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:75
Alarm(grpc::CompletionQueue *cq, const T &deadline, void *tag)
DEPRECATED: Create and set a completion queue alarm instance associated to cq.
Definition: alarm.h:62
Classes that require gRPC to be initialized should inherit from this class.
Definition: grpc_library.h:32
Alarm()
Create an unset Alarm.
Trigger a CompletionQueue event, or asynchronous callback execution, after some deadline.
Definition: alarm.h:46
An interface allowing implementors to process and filter event tags.
Definition: completion_queue_tag.h:26
~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:105
Analogous to struct timespec.
Definition: time.h:48
void Set(const T &deadline, std::function< void(bool)> f)
Set an alarm to invoke callback f.
Definition: alarm.h:98
If you are trying to use CompletionQueue::AsyncNext with a time class that isn't either gpr_timespec ...
Definition: time.h:40