From 85ad685e5771d53d3f2ca667995498efe4dff1dd Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 13 Aug 2015 16:13:10 -0700 Subject: Address comments and update grpc plugins --- include/grpc/grpc.h | 23 +++++++++++++---------- include/grpc/grpc_zookeeper.h | 11 +++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 943982554a..fe4d9f929f 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -355,12 +355,15 @@ typedef struct grpc_op { } data; } grpc_op; +/** Registers a plugin to be initialized and destroyed with the library. -/** Registers a plugin to be initialized and deinitialized with the library. - - It is safe to pass NULL to either argument. The initialization and - deinitialization order isn't guaranteed. */ -void grpc_register_plugin(void (*init)(void), void (*deinit)(void)); + The \a init and \a destroy functions will be invoked as part of + \a grpc_init() and \a grpc_shutdown(), respectively. + Note that these functions can be invoked an arbitrary number of times + (and hence so will \a init and \a destroy). + It is safe to pass NULL to either argument. Plugins are destroyed in + the reverse order they were initialized. */ +void grpc_register_plugin(void (*init)(void), void (*destroy)(void)); /** Frees the memory used by all the plugin information. @@ -381,8 +384,8 @@ void grpc_unregister_all_plugins(); /* Default propagation mask: clients of the core API are encouraged to encode deltas from this in their implementations... ie write: - GRPC_PROPAGATE_DEFAULTS & ~GRPC_PROPAGATE_DEADLINE to disable deadline - propagation. Doing so gives flexibility in the future to define new + GRPC_PROPAGATE_DEFAULTS & ~GRPC_PROPAGATE_DEADLINE to disable deadline + propagation. Doing so gives flexibility in the future to define new propagation types that are default inherited or not. */ #define GRPC_PROPAGATE_DEFAULTS \ ((gpr_uint32)(( \ @@ -429,8 +432,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, 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_completion_queue_pluck simultaneously on the same completion queue. + Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS concurrently executing plucks at any time. */ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, @@ -470,7 +473,7 @@ void grpc_channel_watch_connectivity_state( completions are sent to 'completion_queue'. 'method' and 'host' need only live through the invocation of this function. If parent_call is non-NULL, it must be a server-side call. It will be used - to propagate properties from the server call to this new client call. + to propagate properties from the server call to this new client call. */ grpc_call *grpc_channel_create_call(grpc_channel *channel, grpc_call *parent_call, diff --git a/include/grpc/grpc_zookeeper.h b/include/grpc/grpc_zookeeper.h index d1eeff3be5..2b195c18bf 100644 --- a/include/grpc/grpc_zookeeper.h +++ b/include/grpc/grpc_zookeeper.h @@ -31,6 +31,17 @@ * */ +/** Support zookeeper as alternative name system in addition to DNS + * Zookeeper name in gRPC is represented as a URI: + * zookeeper://host:port/path/service/instance + * + * Where zookeeper is the name system scheme + * host:port is the address of a zookeeper server + * /path/service/instance is the zookeeper name to be resolved + * + * Refer doc/naming.md for more details + */ + #ifndef GRPC_GRPC_ZOOKEEPER_H #define GRPC_GRPC_ZOOKEEPER_H -- cgit v1.2.3