GRPC Core
0.10.0.0
|
#include "src/core/surface/completion_queue.h"
#include <stdio.h>
#include <string.h>
#include "src/core/iomgr/pollset.h"
#include "src/core/surface/call.h"
#include "src/core/surface/event_string.h"
#include "src/core/surface/surface_trace.h"
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
Data Structures | |
struct | grpc_completion_queue |
grpc_completion_queue* grpc_completion_queue_create | ( | void | ) |
Create a completion queue.
void grpc_completion_queue_destroy | ( | grpc_completion_queue * | cq | ) |
Destroy a completion queue.
The caller must ensure that the queue is drained and no threads are executing grpc_completion_queue_next
grpc_event grpc_completion_queue_next | ( | grpc_completion_queue * | cq, |
gpr_timespec | deadline | ||
) |
Blocks until an event is available, the completion queue is being shut down, or deadline is reached.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout, otherwise a grpc_event describing the event that occurred.
Callers must not call grpc_completion_queue_next and grpc_completion_queue_pluck simultaneously on the same completion queue.
grpc_event grpc_completion_queue_pluck | ( | grpc_completion_queue * | cq, |
void * | tag, | ||
gpr_timespec | deadline | ||
) |
Blocks until an event with tag 'tag' is available, the completion queue is being shutdown or deadline is reached.
Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout, otherwise a grpc_event describing the event that occurred.
Callers must not call grpc_completion_queue_next and grpc_completion_queue_pluck simultaneously on the same completion queue.
void grpc_completion_queue_shutdown | ( | grpc_completion_queue * | cq | ) |
Begin destruction of a completion queue.
Once all possible events are drained then grpc_completion_queue_next will start to produce GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call grpc_completion_queue_destroy.
After calling this function applications should ensure that no NEW work is added to be published on this completion queue.
void grpc_cq_begin_op | ( | grpc_completion_queue * | cc | ) |
void grpc_cq_end_op | ( | grpc_completion_queue * | cc, |
void * | tag, | ||
int | success, | ||
void(*)(void *done_arg, grpc_cq_completion *storage) | done, | ||
void * | done_arg, | ||
grpc_cq_completion * | storage | ||
) |
void grpc_cq_hack_spin_pollset | ( | grpc_completion_queue * | cc | ) |
void grpc_cq_internal_ref | ( | grpc_completion_queue * | cc | ) |
void grpc_cq_internal_unref | ( | grpc_completion_queue * | cc | ) |
int grpc_cq_is_server_cq | ( | grpc_completion_queue * | cc | ) |
void grpc_cq_mark_server_cq | ( | grpc_completion_queue * | cc | ) |
grpc_pollset* grpc_cq_pollset | ( | grpc_completion_queue * | cc | ) |