diff options
author | 2015-10-04 23:09:47 -0700 | |
---|---|---|
committer | 2015-10-04 23:09:47 -0700 | |
commit | f747bbc04327c9ef02690cd7466ec6786967c4fe (patch) | |
tree | b031152a4387370999e91d9922fef90efc86f3ac /include | |
parent | cb954cfc2858829fe7bff785b1a5d5204bfd338f (diff) |
s/grpc_alarm/grpc_timer && s/grpc_cq_alarm/grpc_alarm
Diffstat (limited to 'include')
-rw-r--r-- | include/grpc/grpc.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 0c854a5b0c..84102c0c75 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -56,6 +56,9 @@ extern "C" { actions. */ typedef struct grpc_completion_queue grpc_completion_queue; +/** An alarm associated with a completion queue. */ +typedef struct grpc_alarm grpc_alarm; + /** The Channel interface allows creation of Call objects. */ typedef struct grpc_channel grpc_channel; @@ -475,6 +478,21 @@ void grpc_completion_queue_shutdown(grpc_completion_queue *cq); drained and no threads are executing grpc_completion_queue_next */ void grpc_completion_queue_destroy(grpc_completion_queue *cq); +/** Create a completion queue alarm instance associated to \a cq. + * + * Once the alarm expires (at \a deadline) or it's cancelled (see ...), an event + * with tag \a tag will be added to \a cq. If the alarm expired, the event's + * success bit will be true, false otherwise (ie, upon cancellation). */ +grpc_alarm *grpc_alarm_create(grpc_completion_queue *cq, gpr_timespec deadline, + void *tag); + +/** Cancel a completion queue alarm. Calling this function ove an alarm that has + * already run has no effect. */ +void grpc_alarm_cancel(grpc_alarm *alarm); + +/** Destroy the given completion queue alarm, cancelling it in the process. */ +void grpc_alarm_destroy(grpc_alarm *alarm); + /** Check the connectivity state of a channel. */ grpc_connectivity_state grpc_channel_check_connectivity_state( grpc_channel *channel, int try_to_connect); |