From 5b32d8dc55c9ac1776230ab7b24a5e0629d2ed55 Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Fri, 15 Dec 2023 22:59:53 +0000 Subject: [PATCH] pw_async2: Fix documentation style Change-Id: I852f434c56aa6e5bb70d3e2032dfe99813899676 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/185278 Pigweed-Auto-Submit: Taylor Cramer Reviewed-by: Kayce Basques Presubmit-Verified: CQ Bot Account Commit-Queue: Kayce Basques --- pw_async2/docs.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pw_async2/docs.rst b/pw_async2/docs.rst index f31b9152e6..02e59d552e 100644 --- a/pw_async2/docs.rst +++ b/pw_async2/docs.rst @@ -5,7 +5,7 @@ pw_async2 ============= .. pigweed-module:: :name: pw_async2 - :tagline: Exception-free error propagation for embedded + :tagline: Cooperative async tasks for embedded :status: experimental :languages: C++17 @@ -19,7 +19,7 @@ pw_async2 like other tasks, and can easily plug into an existing ``pw_async2`` systems. -:cpp:type:`pw::async2::Task` is Pigweed's async primitive. ``Task`` s +:cpp:type:`pw::async2::Task` is Pigweed's async primitive. ``Task`` objects are cooperatively-scheduled "threads" which yield to the ``Dispatcher`` when waiting. When the ``Task`` is able to make progress, the ``Dispatcher`` will run it again. For example: @@ -47,8 +47,8 @@ will run it again. For example: // ``PendReceive`` checks for available data or errors. // // If no data is available, it will grab a ``Waker`` from - // `cx.Waker()` and return ``Pending``. When data arrives, - // it will call `waker.Wake()` which tells the ``Dispatcher`` to + // ``cx.Waker()`` and return ``Pending``. When data arrives, + // it will call ``waker.Wake()`` which tells the ``Dispatcher`` to // ``Pend`` this ``Task`` again. Poll> new_data = receiver_.PendReceive(cx); if (new_data.is_pending()) { @@ -100,6 +100,9 @@ method: return 0; } +------- +Roadmap +------- Coming soon: C++20 users can also define tasks using coroutines! .. code-block:: cpp @@ -124,7 +127,7 @@ Coming soon: C++20 users can also define tasks using coroutines! } ----------------- -C++ API Reference +C++ API reference ----------------- .. doxygenclass:: pw::async2::Task :members: