From b807c700dc8398deebcb502dc5a0204ab9f5f1fe Mon Sep 17 00:00:00 2001 From: Klemens Morgenstern Date: Sun, 11 Jan 2026 07:27:47 +0800 Subject: [PATCH] doc typo fixes --- doc/motivation.adoc | 6 +++--- doc/reference/gather.adoc | 2 +- doc/reference/generators.adoc | 2 +- doc/reference/join.adoc | 2 +- doc/reference/main.adoc | 8 ++++---- doc/reference/op.adoc | 2 +- doc/reference/race.adoc | 2 +- doc/reference/task.adoc | 2 +- doc/reference/thread.adoc | 4 ++-- doc/reference/with.adoc | 2 +- doc/tour/entry.adoc | 6 +++--- doc/tutorial/echo_server.adoc | 2 +- readme.md | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/motivation.adoc b/doc/motivation.adoc index 2f2654f..519d9cc 100644 --- a/doc/motivation.adoc +++ b/doc/motivation.adoc @@ -1,6 +1,6 @@ = Motivation -Many languages programming languages +Many programming languages like node.js and python provide easy to use single-threaded concurrency frameworks. While more complex than synchronous code, single threaded asynchronicity avoids many of the pitfalls & overhead of multi-threading. @@ -11,9 +11,9 @@ This allows to write applications that *do multiple things simultaneously* on a This library is meant to provide this to C++: *simple single threaded asynchronicity* akin to node.js and asyncio in python that works with existing libraries like `boost.beast`, `boost.mysql` or `boost.redis`. -It based on `boost.asio`. +It is based on `boost.asio`. -It takes a collection of concepts from other languages and provides them based on C++20 coroutines. +It takes a collection of concepts from other languages and provides them based on C++20 coroutines. - easy asynchronous base functions, such as an async <> & <> - <> & <> types diff --git a/doc/reference/gather.adoc b/doc/reference/gather.adoc index 10f9783..7529a06 100644 --- a/doc/reference/gather.adoc +++ b/doc/reference/gather.adoc @@ -5,7 +5,7 @@ The `gather` function can be used to `co_await` multiple <> or as on a range of <>. diff --git a/doc/reference/generators.adoc b/doc/reference/generators.adoc index 780d0cd..609158d 100644 --- a/doc/reference/generators.adoc +++ b/doc/reference/generators.adoc @@ -174,7 +174,7 @@ cobalt::generator my_gen(std::allocator_arg_t, pmr::polymorphic_allocator This allows code like `while (gen) co_await gen:` +<1> This allows code like `while (gen) co_await gen;` <2> Supports <> <3> A cancelled generator maybe be resumable diff --git a/doc/reference/join.adoc b/doc/reference/join.adoc index aa526be..44dbd71 100644 --- a/doc/reference/join.adoc +++ b/doc/reference/join.adoc @@ -60,5 +60,5 @@ template get the executor `main` running on <2> Use it with an asio object -<3> `co_await` an cobalt operation +<3> `co_await` a cobalt operation The main promise will create an `asio::signal_set` and uses it for cancellation. `SIGINT` becomes total , while `SIGTERM` becomes terminal cancellation. NOTE: The cancellation will not be forwarded to detached coroutines. -The user will need to take care to end then on cancellation, +The user will need to take care to end them on cancellation, since the program otherwise doesn't allow graceful termination. === Executor @@ -42,7 +42,7 @@ It will be assigned to the `cobalt::this_thread::get_executor()` . [#main-allocator] It also creates a memory resource that will be used as a default for internal memory allocations. -It will be assigned to the `thread_local` to the `cobalt::this_thread::get_default_resource()`. +It will be assigned to `cobalt::this_thread::get_default_resource()`. [#main-promise] === Promise diff --git a/doc/reference/op.adoc b/doc/reference/op.adoc index 4dea53b..7f9a557 100644 --- a/doc/reference/op.adoc +++ b/doc/reference/op.adoc @@ -6,7 +6,7 @@ An operation in `cobalt` is an <> wrapping an `asio` opera [#use_op] === use_op -The `use_op` token is the direct to create an op, +The `use_op` token is the direct way to create an op, i.e. using `cobalt::use_op` as the completion token will create the required awaitable. [source,cpp] diff --git a/doc/reference/race.adoc b/doc/reference/race.adoc index 6b5f3a0..055f7b7 100644 --- a/doc/reference/race.adoc +++ b/doc/reference/race.adoc @@ -20,7 +20,7 @@ cobalt::promise do_wait() <1> Wait for a variadic set of <> <2> wait for a vector of <> -The first parameter so `race` can be a https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator::[uniform random bit generator]. +The first parameter so `race` can be a https://en.cppreference.com/w/cpp/named_req/UniformRandomBitGenerator[uniform random bit generator]. .Signatures of race diff --git a/doc/reference/task.adoc b/doc/reference/task.adoc index 560bdef..50c76e9 100644 --- a/doc/reference/task.adoc +++ b/doc/reference/task.adoc @@ -31,7 +31,7 @@ Otherwise, it'll default to the thread_local executor. [#task-allocator] The memory resource is *NOT* taken from the `thread_local` <> function, -but `pmr::get_default_resource(), +but `pmr::get_default_resource()`, unless a `std::allocator_arg` is used in any position followed by a `polymorphic_allocator` argument. [source, cpp] diff --git a/doc/reference/thread.adoc b/doc/reference/thread.adoc index 1d30e36..1204543 100644 --- a/doc/reference/thread.adoc +++ b/doc/reference/thread.adoc @@ -15,7 +15,7 @@ cobalt::thread my_thread() ---- <1> get the executor `thread` running on <2> Use it with an asio object -<3> `co_await` an cobalt operation +<3> `co_await` a cobalt operation To use a thread you can use it like a `std::thread`: @@ -58,7 +58,7 @@ It will be assigned to the `cobalt::this_thread::get_executor()` . [#thread-allocator] It also creates a memory resource that will be used as a default for internal memory allocations. -It will be assigned to the `thread_local` to the `cobalt::this_thread::get_default_resource()`. +It will be assigned to `cobalt::this_thread::get_default_resource()`. [#thread-outline] === Outline diff --git a/doc/reference/with.adoc b/doc/reference/with.adoc index 25d0329..1ac35a2 100644 --- a/doc/reference/with.adoc +++ b/doc/reference/with.adoc @@ -24,7 +24,7 @@ that returns an <> or by providing the teardown as the thi [source,cpp] ---- -using ws_stream = beast::websocket::stream>; +using ws_stream = beast::websocket::stream; cobalt::promise connect(urls::url); // <1> cobalt::promise disconnect(ws_stream &ws); // <2> diff --git a/doc/tour/entry.adoc b/doc/tour/entry.adoc index ed664e4..da13026 100644 --- a/doc/tour/entry.adoc +++ b/doc/tour/entry.adoc @@ -1,4 +1,4 @@ -== Entry into an cobalt environment +== Entry into a cobalt environment In order to use <> we need to be able to `co_await` them, i.e. be within a coroutine. @@ -24,7 +24,7 @@ cobalt::thread my_thread() co_return; } -int main(int argc, char ** argv[]) +int main(int argc, char * argv[]) { auto t = my_thread(); t.join(); @@ -41,7 +41,7 @@ cobalt::task my_thread() co_return; } -int main(int argc, char ** argv[]) +int main(int argc, char * argv[]) { cobalt::run(my_task()); // sync asio::io_context ctx; diff --git a/doc/tutorial/echo_server.adoc b/doc/tutorial/echo_server.adoc index 0eb7a59..1d34af1 100644 --- a/doc/tutorial/echo_server.adoc +++ b/doc/tutorial/echo_server.adoc @@ -79,5 +79,5 @@ include::../../example/echo_server.cpp[tag=main] The <> function shown above, will run a function with a resource such as <>. On scope exit `with` will invoke & `co_await` an asynchronous teardown function. -This will cause all connections to be properly shutdown before `co_main` exists. +This will cause all connections to be properly shutdown before `co_main` exits. diff --git a/readme.md b/readme.md index b9484c4..bf99b0c 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ This library provides a set of easy to use coroutine primitives & utilities running on top of boost.asio. These will be of interest for applications that perform a lot of IO that want to not block unnecessarily, -yet still want to have linear & readable code (i..e. avoid callbacks). +yet still want to have linear & readable code (i.e. avoid callbacks). A minimum of Boost 1.82 is necessary as the ASIO in that version has needed support. C++ 20 is needed for C++ coroutines. @@ -244,7 +244,7 @@ cobalt::promise delay(int ms) cobalt::main co_main(int argc, char ** argv) { auto res = co_await race(delay(100), delay(50)); - asert(res == 1); // delay(50) completes earlier, delay(100) is not cancelled + assert(res == 1); // delay(50) completes earlier, delay(100) is not cancelled co_return 0u; } ```