aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc/impl
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-09-19 23:51:24 -0700
committerGravatar Vijay Pai <vpai@google.com>2018-09-19 23:57:56 -0700
commit9e6511ae2eb3c982bcea88096cbe079147b25fa4 (patch)
tree85d85313559030d1f97ec1d594855e5c8e8b25a8 /include/grpc/impl
parent830e5ad5df749a5bbcb0d6bace79b7f3fe306a9e (diff)
Make the core callback interface API so that it can be used in generated code
Diffstat (limited to 'include/grpc/impl')
-rw-r--r--include/grpc/impl/codegen/grpc_types.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h
index 5f3b96f40b..5bd50bc9ac 100644
--- a/include/grpc/impl/codegen/grpc_types.h
+++ b/include/grpc/impl/codegen/grpc_types.h
@@ -660,6 +660,19 @@ typedef enum {
GRPC_CQ_CALLBACK
} grpc_cq_completion_type;
+/** EXPERIMENTAL: Specifies an interface class to be used as a tag
+ for callback-based completion queues. This can be used directly,
+ as the first element of a struct in C, or as a base class in C++.
+ Its "run" value should be assigned to some non-member function, such as
+ a static method. */
+typedef struct grpc_experimental_completion_queue_functor {
+ /** The run member specifies a function that will be called when this
+ tag is extracted from the completion queue. Its arguments will be a
+ pointer to this functor and a boolean that indicates whether the
+ success status of this operation */
+ void (*functor_run)(struct grpc_experimental_completion_queue_functor*, int);
+} grpc_experimental_completion_queue_functor;
+
/* The upgrade to version 2 is currently experimental. */
#define GRPC_CQ_CURRENT_VERSION 2
@@ -678,7 +691,7 @@ typedef struct grpc_completion_queue_attributes {
/* EXPERIMENTAL: START OF VERSION 2 CQ ATTRIBUTES */
/** When creating a callbackable CQ, pass in a functor to get invoked when
* shutdown is complete */
- void* cq_shutdown_cb;
+ grpc_experimental_completion_queue_functor* cq_shutdown_cb;
/* END OF VERSION 2 CQ ATTRIBUTES */
} grpc_completion_queue_attributes;