Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Tradias/asio-grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tradias committed Jul 24, 2022
2 parents d1088df + 2dbef51 commit b22399e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ For clients only:
```cpp
agrpc::GrpcContext grpc_context{std::make_unique<grpc::CompletionQueue>()};
```
<sup><a href='/example/snippets/client.cpp#L353-L355' title='Snippet source file'>snippet source</a> | <a href='#snippet-create-grpc_context-client-side' title='Start of snippet'>anchor</a></sup>
<sup><a href='/example/snippets/client.cpp#L355-L357' title='Snippet source file'>snippet source</a> | <a href='#snippet-create-grpc_context-client-side' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Add some work to the `grpc_context` and run it. Make sure to shutdown the `server` before destructing the `grpc_context`. Also destruct the `grpc_context` before destructing the `server`. A `grpc_context` can only be run on one thread at a time.
Expand All @@ -341,7 +341,7 @@ It might also be helpful to create a work guard before running the `agrpc::GrpcC
```cpp
std::optional guard{asio::require(grpc_context.get_executor(), asio::execution::outstanding_work_t::tracked)};
```
<sup><a href='/example/snippets/client.cpp#L357-L359' title='Snippet source file'>snippet source</a> | <a href='#snippet-make-work-guard' title='Start of snippet'>anchor</a></sup>
<sup><a href='/example/snippets/client.cpp#L359-L361' title='Snippet source file'>snippet source</a> | <a href='#snippet-make-work-guard' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
## Where to go from here?
Expand Down

0 comments on commit b22399e

Please sign in to comment.