Skip to content

Commit

Permalink
pw_async2: Fix documentation style
Browse files Browse the repository at this point in the history
Change-Id: I852f434c56aa6e5bb70d3e2032dfe99813899676
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/185278
Pigweed-Auto-Submit: Taylor Cramer <[email protected]>
Reviewed-by: Kayce Basques <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Commit-Queue: Kayce Basques <[email protected]>
  • Loading branch information
cramertj authored and CQ Bot Account committed Dec 15, 2023
1 parent 2a2b4ff commit 5b32d8d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pw_async2/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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<pw::Result<Data>> new_data = receiver_.PendReceive(cx);
if (new_data.is_pending()) {
Expand Down Expand Up @@ -100,6 +100,9 @@ method:
return 0;
}
-------
Roadmap
-------
Coming soon: C++20 users can also define tasks using coroutines!

.. code-block:: cpp
Expand All @@ -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:
Expand Down

0 comments on commit 5b32d8d

Please sign in to comment.