~/talk

Introduction to C++ Coroutines and gRPC and How to Write Coroutine Support Code

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [c-and-cpp, networking]
links:none on file
slides:none on file

Explains how to add coroutine support to gRPC by writing a custom promise type and an awaitable/awaiter that starts start_write, stores the coroutine_handle in the reactor, and resumes it from on_write_done; implements server-streaming send as a straightforward suspend/resume loop. Demonstrates this works with the gRPC reactor API, uses C++20 coroutines and Boost AIO as options, and claims the support is a few pages of code (scales to a few hundred lines) with examples and slides on GitHub.

AI-written summary · about

  1. 0:00Introduction
  2. 1:09Coroutines & gRPC background
  3. 5:49C++ coroutines basics
  4. 7:17Language support & return types
  5. 9:03Generators explained
  6. 11:30Task-based async
  7. 19:16gRPC introduction
  8. 20:40Sync vs reactor gRPC
  9. 26:35Coroutines for gRPC streaming
  10. 30:27Simplest coroutine support
  11. 38:14Promise type & transformations
  12. 40:41Simplest gRPC coroutine
  13. 45:14Sending responses with coroutines
  14. 50:55Implementing awaiters
  15. 54:06Summary & next steps
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.