Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
91bd627d
Commit
91bd627d
authored
9 years ago
by
Greg Haines
Browse files
Options
Downloads
Patches
Plain Diff
Feedback from @jcanizales and @vjpai
parent
42dab364
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+6
-7
6 additions, 7 deletions
src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
with
6 additions
and
7 deletions
src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
+
6
−
7
View file @
91bd627d
...
@@ -60,7 +60,6 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
...
@@ -60,7 +60,6 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
// anymore (i.e. on self dealloc). So the block would never end if it
// anymore (i.e. on self dealloc). So the block would never end if it
// retained self.
// retained self.
grpc_completion_queue
*
unmanagedQueue
=
_unmanagedQueue
;
grpc_completion_queue
*
unmanagedQueue
=
_unmanagedQueue
;
int64_t
lTimeoutSecs
=
_timeoutSecs
;
// Start a loop on a concurrent queue to read events from the completion
// Start a loop on a concurrent queue to read events from the completion
// queue and dispatch each.
// queue and dispatch each.
...
@@ -70,18 +69,18 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
...
@@ -70,18 +69,18 @@ const int64_t kGRPCCompletionQueueDefaultTimeoutSecs = 60;
gDefaultConcurrentQueue
=
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
);
gDefaultConcurrentQueue
=
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
);
});
});
dispatch_async
(
gDefaultConcurrentQueue
,
^
{
dispatch_async
(
gDefaultConcurrentQueue
,
^
{
gpr_timespec
deadline
=
gpr_time_from_seconds
(
lT
imeoutSecs
,
GPR_CLOCK_REALTIME
);
gpr_timespec
deadline
=
gpr_time_from_seconds
(
t
imeoutSecs
,
GPR_CLOCK_REALTIME
);
while
(
YES
)
{
while
(
YES
)
{
// The following call blocks until an event is available or the deadline elapses.
// The following call blocks until an event is available or the deadline elapses.
grpc_event
event
=
grpc_completion_queue_next
(
unmanagedQueue
,
deadline
,
NULL
);
grpc_event
event
=
grpc_completion_queue_next
(
unmanagedQueue
,
deadline
,
NULL
);
GRPCQueueCompletionHandler
handler
;
GRPCQueueCompletionHandler
handler
;
switch
(
event
.
type
)
{
switch
(
event
.
type
)
{
case
GRPC_OP_COMPLETE
:
// Falling through deliberately
case
GRPC_OP_COMPLETE
:
case
GRPC_QUEUE_TIMEOUT
:
handler
=
(
__bridge_transfer
GRPCQueueCompletionHandler
)
event
.
tag
;
handler
=
(
__bridge_transfer
GRPCQueueCompletionHandler
)
event
.
tag
;
if
(
handler
)
{
handler
(
event
.
success
);
handler
(
event
.
success
);
break
;
}
case
GRPC_QUEUE_TIMEOUT
:
// Nothing to do here
break
;
break
;
case
GRPC_QUEUE_SHUTDOWN
:
case
GRPC_QUEUE_SHUTDOWN
:
grpc_completion_queue_destroy
(
unmanagedQueue
);
grpc_completion_queue_destroy
(
unmanagedQueue
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment