mirror of
https://github.com/boostorg/cobalt.git
synced 2026-01-19 04:02:16 +00:00
54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
:example-path: https://github.com/boostorg/cobalt/tree/master/example
|
|
|
|
== Advanced examples
|
|
|
|
More examples are provided in the repository as code only. All examples are listed below.
|
|
|
|
.All examples
|
|
[cols="1,5"]
|
|
|===
|
|
|
|
|{example-path}/http.cpp[example/http.cpp]
|
|
| An http client that performs a single http get request.
|
|
|
|
|{example-path}/outcome.cpp[example/outcome.cpp]
|
|
| Using the `boost.outcome` coroutine types.
|
|
|
|
|{example-path}/python.cpp[example/python.cpp] & {example-path}/python.py[example/python.py]
|
|
| Using nanobind to integrate cobalt with python.
|
|
It uses python's asyncio as executor and allows C++ to co_await python functions et vice versa.
|
|
|
|
|{example-path}/signals.cpp[example/signals.cpp]
|
|
| Adopting `boost.signals2` into an awaitable type (single threaded).
|
|
|
|
|{example-path}/spsc.cpp[example/spsc.cpp]
|
|
| Creating a `boost.lockfree` based & awaitable `spsc_queue` (multi threaded).
|
|
|
|
|{example-path}/thread.cpp[example/thread.cpp]
|
|
| Using worker threads with `asio`'s `concurrent_channel`.
|
|
|
|
|{example-path}/thread_pool.cpp[example/thread_pool.cpp]
|
|
| Using an `asio::thread_pool` and spawning <<task, tasks>> onto them.
|
|
|
|
|
|
|{example-path}/delay.cpp[example/delay.cpp]
|
|
|The example used by the <<delay>> section
|
|
|
|
|{example-path}/delay_op.cpp[example/delay_op.cpp]
|
|
|The example used by the <<delay_op>> section
|
|
|
|
|{example-path}/echo_server.cpp[example/echo_server.cpp]
|
|
|The example used by the <<echo_server>> section
|
|
|
|
|{example-path}/ticker.cpp[example/ticker.cpp]
|
|
|The example used by the <<price ticker>> section
|
|
|
|
|{example-path}/channel.cpp[example/channel.cpp]
|
|
|The example used by the <<channel, channel>> reference
|
|
|
|
|
|
|===
|
|
|
|
|
|
|