aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-06-07 10:45:10 -0700
committerGravatar GitHub <noreply@github.com>2018-06-07 10:45:10 -0700
commitd7728cda51ee1249e88f7d20dec92435f8d33d53 (patch)
treeba7438d62547e2f4793498477f7931e5cb5ea0d8 /src/objective-c/GRPCClient
parenta323b51ece13ee8b28788b7d03cada6daeb215cd (diff)
parent08876dadce36200d191b2d7751c8437aa558d9b2 (diff)
Merge pull request #15069 from muxi/prototype-cfstream
Implementation of CFStream
Diffstat (limited to 'src/objective-c/GRPCClient')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCCompletionQueue.m11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
index 57dbde8d04..bda1c3360b 100644
--- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
@@ -20,6 +20,14 @@
#import <grpc/grpc.h>
+#ifdef GRPC_CFSTREAM
+const grpc_completion_queue_attributes kCompletionQueueAttr = {GRPC_CQ_CURRENT_VERSION,
+ GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING};
+#else
+const grpc_completion_queue_attributes kCompletionQueueAttr = {
+ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING};
+#endif
+
@implementation GRPCCompletionQueue
+ (instancetype)completionQueue {
@@ -33,7 +41,8 @@
- (instancetype)init {
if ((self = [super init])) {
- _unmanagedQueue = grpc_completion_queue_create_for_next(NULL);
+ _unmanagedQueue = grpc_completion_queue_create(
+ grpc_completion_queue_factory_lookup(&kCompletionQueueAttr), &kCompletionQueueAttr, NULL);
// This is for the following block to capture the pointer by value (instead
// of retaining self and doing self->_unmanagedQueue). This is essential