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
2add9806
Commit
2add9806
authored
9 years ago
by
yang-g
Browse files
Options
Downloads
Patches
Plain Diff
Resolve comments
parent
0c633513
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
cpp/helloworld/README.md
+12
-12
12 additions, 12 deletions
cpp/helloworld/README.md
with
12 additions
and
12 deletions
cpp/helloworld/README.md
+
12
−
12
View file @
2add9806
...
@@ -160,15 +160,15 @@ gRPC uses `CompletionQueue` API for asynchronous operations. The basic work flow
...
@@ -160,15 +160,15 @@ gRPC uses `CompletionQueue` API for asynchronous operations. The basic work flow
is
is
-
bind a
`CompletionQueue`
to a rpc call
-
bind a
`CompletionQueue`
to a rpc call
-
do something like a read or write, present with a unique
`void*`
tag
-
do something like a read or write, present with a unique
`void*`
tag
-
call
`CompletionQueue::Next`
to
poll the events
. If
the
tag
appears, the
-
call
`CompletionQueue::Next`
to
wait for operations to complete
. If
a
tag
previous operation finishes
.
appears, it indicates that the corresponding operation is complete
.
#### Async client
#### Async client
The channel and stub creation code is the same as the sync client.
The channel and stub creation code is the same as the sync client.
-
Initiate the rpc and create a handle for the rpc. Bind
a
`CompletionQueue`
to
-
Initiate the rpc and create a handle for the rpc. Bind
the rpc
to
a
it
.
`CompletionQueue`
.
```
```
CompletionQueue cq;
CompletionQueue cq;
...
@@ -182,8 +182,8 @@ The channel and stub creation code is the same as the sync client.
...
@@ -182,8 +182,8 @@ The channel and stub creation code is the same as the sync client.
rpc->Finish(&reply, &status, (void*)1);
rpc->Finish(&reply, &status, (void*)1);
```
```
-
Poll
the completion queue
for the
tag. The reply and status are
ready once the
-
Wait for
the completion queue
to return the next
tag. The reply and status are
tag
is returned.
ready once the tag passed into the corresponding
`Finish()`
call
is returned.
```
```
void* got_tag;
void* got_tag;
...
@@ -198,8 +198,8 @@ For a working example, refer to [greeter_async_client.cc](https://github.com/grp
...
@@ -198,8 +198,8 @@ For a working example, refer to [greeter_async_client.cc](https://github.com/grp
#### Async server
#### Async server
The server implementation requests a rpc call with a tag and then
poll
the
The server implementation requests a rpc call with a tag and then
wait for
the
completion queue
for
the tag. The basic flow is
completion queue
to return
the tag. The basic flow is
-
Build a server exporting the async service
-
Build a server exporting the async service
...
@@ -221,8 +221,8 @@ completion queue for the tag. The basic flow is
...
@@ -221,8 +221,8 @@ completion queue for the tag. The basic flow is
service.RequestSayHello(&context, &request, &responder, &cq, &cq, (void*)1);
service.RequestSayHello(&context, &request, &responder, &cq, &cq, (void*)1);
```
```
-
Poll
the completion queue
for
the tag. The context, request and
responder are
-
Wait for
the completion queue
to return
the tag. The context, request and
ready once the tag is retrieved.
responder are
ready once the tag is retrieved.
```
```
HelloReply reply;
HelloReply reply;
...
@@ -236,8 +236,8 @@ completion queue for the tag. The basic flow is
...
@@ -236,8 +236,8 @@ completion queue for the tag. The basic flow is
}
}
```
```
-
Poll
the completion queue
for
the tag. The rpc is finished when the
tag is
-
Wait for
the completion queue
to return
the tag. The rpc is finished when the
back.
tag is
back.
```
```
void* got_tag;
void* got_tag;
...
...
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