Add channel argument documentation

pull/562/head
Craig Tiller 10 years ago
parent b4215bba56
commit 29f2b219a8
  1. 15
      include/grpc/grpc.h

@ -92,7 +92,12 @@ 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
by grpc_arg; keys are strings to allow easy backwards-compatible extension
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;
@ -400,7 +405,10 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel,
grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops,
size_t nops, void *tag); size_t nops, void *tag);
/* Create a client channel */ /* Create a client channel to 'target'. Additional channel level configuration
MAY be provided by grpc_channel_args, though the expectation is that most
clients will want to simply pass NULL. See grpc_channel_args definition
for more on this. */
grpc_channel *grpc_channel_create(const char *target, grpc_channel *grpc_channel_create(const char *target,
const grpc_channel_args *args); const grpc_channel_args *args);
@ -545,7 +553,8 @@ grpc_call_error grpc_server_request_call(
grpc_metadata_array *request_metadata, grpc_metadata_array *request_metadata,
grpc_completion_queue *completion_queue, void *tag_new); grpc_completion_queue *completion_queue, void *tag_new);
/* Create a server */ /* Create a server. Additional configuration for each incoming channel can
be specified with args. See grpc_channel_args for more. */
grpc_server *grpc_server_create(grpc_completion_queue *cq, grpc_server *grpc_server_create(grpc_completion_queue *cq,
const grpc_channel_args *args); const grpc_channel_args *args);

Loading…
Cancel
Save