Begin marking up for Doxygen

pull/1738/head
Craig Tiller 10 years ago
parent 818b8769fc
commit e793ba12c6
  1. 77
      include/grpc/grpc.h

@ -92,12 +92,13 @@ typedef struct {
} value; } value;
} grpc_arg; } grpc_arg;
/* An array of arguments that can be passed around. /** An array of arguments that can be passed around.
Used to set optional channel-level configuration.
These configuration options are modelled as key-value pairs as defined Used to set optional channel-level configuration.
by grpc_arg; keys are strings to allow easy backwards-compatible extension These configuration options are modelled as key-value pairs as defined
by arbitrary parties. by grpc_arg; keys are strings to allow easy backwards-compatible extension
All evaluation is performed at channel creation time. */ by arbitrary parties.
All evaluation is performed at channel creation time. */
typedef struct { typedef struct {
size_t num_args; size_t num_args;
grpc_arg *args; grpc_arg *args;
@ -192,15 +193,28 @@ typedef struct grpc_metadata {
} internal_data; } internal_data;
} grpc_metadata; } grpc_metadata;
/** \enum grpc_completion_type
\brief The type of completion (for grpc_event) */
typedef enum grpc_completion_type { typedef enum grpc_completion_type {
GRPC_QUEUE_SHUTDOWN, /* Shutting down */ /** Shutting down */
GRPC_QUEUE_TIMEOUT, /* No event before timeout */ GRPC_QUEUE_SHUTDOWN,
GRPC_OP_COMPLETE /* operation completion */ /** No event before timeout */
GRPC_QUEUE_TIMEOUT,
/** Operation completion */
GRPC_OP_COMPLETE
} grpc_completion_type; } grpc_completion_type;
/** The result of an operation.
Returned by a completion queue when the operation started with tag. */
typedef struct grpc_event { typedef struct grpc_event {
/** The type of the completion. */
grpc_completion_type type; grpc_completion_type type;
/** non-zero if the operation was successful, 0 upon failure.
Only GRPC_OP_COMPLETE can succeed or fail. */
int success; int success;
/** The tag passed to grpc_call_start_batch etc to start this operation.
Only GRPC_OP_COMPLETE has a tag. */
void *tag; void *tag;
} grpc_event; } grpc_event;
@ -319,37 +333,42 @@ typedef struct grpc_op {
} data; } data;
} grpc_op; } grpc_op;
/* Initialize the grpc library. /** Initialize the grpc library.
It is not safe to call any other grpc functions before calling this.
(To avoid overhead, little checking is done, and some things may work. We It is not safe to call any other grpc functions before calling this.
do not warrant that they will continue to do so in future revisions of this (To avoid overhead, little checking is done, and some things may work. We
library). */ do not warrant that they will continue to do so in future revisions of this
library). */
void grpc_init(void); void grpc_init(void);
/* Shut down the grpc library. /** Shut down the grpc library.
No memory is used by grpc after this call returns, nor are any instructions
executing within the grpc library. No memory is used by grpc after this call returns, nor are any instructions
Prior to calling, all application owned grpc objects must have been executing within the grpc library.
destroyed. */ Prior to calling, all application owned grpc objects must have been
destroyed. */
void grpc_shutdown(void); void grpc_shutdown(void);
/** Create a completion queue */
grpc_completion_queue *grpc_completion_queue_create(void); grpc_completion_queue *grpc_completion_queue_create(void);
/* Blocks until an event is available, the completion queue is being shut down, /** Blocks until an event is available, the completion queue is being shut down,
or deadline is reached. Returns NULL on timeout, otherwise the event that or deadline is reached.
occurred.
Returns NULL on timeout, otherwise the event that occurred.
Callers must not call grpc_completion_queue_next and Callers must not call grpc_completion_queue_next and
grpc_completion_queue_pluck simultaneously on the same completion queue. */ grpc_completion_queue_pluck simultaneously on the same completion queue. */
grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
gpr_timespec deadline); gpr_timespec deadline);
/* Blocks until an event with tag 'tag' is available, the completion queue is /** Blocks until an event with tag 'tag' is available, the completion queue is
being shutdown or deadline is reached. Returns NULL on timeout, or a pointer being shutdown or deadline is reached.
to the event that occurred.
Returns NULL on timeout, or a pointer to the event that occurred.
Callers must not call grpc_completion_queue_next and Callers must not call grpc_completion_queue_next and
grpc_completion_queue_pluck simultaneously on the same completion queue. */ grpc_completion_queue_pluck simultaneously on the same completion queue. */
grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag,
gpr_timespec deadline); gpr_timespec deadline);

Loading…
Cancel
Save