mirror of
https://github.com/boostorg/mqtt5.git
synced 2025-10-04 04:40:55 +02:00
Summary: related to T12804 Reviewers: iljazovic Reviewed By: iljazovic Subscribers: miljen Differential Revision: https://repo.mireo.local/D26547
41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
[/
|
|
Copyright (c) 2023 Mireo
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
]
|
|
|
|
[section:asio Compatibility with Boost.Asio]
|
|
The __Client__ is built upon __Asio__ and thus follows the same principles.
|
|
This section illustrates the usage of __Client__ async
|
|
functions with different __CompletionToken__.
|
|
|
|
# [link async_mqtt5.examples.asio.callbacks Async functions with callbacks]
|
|
# [link async_mqtt5.examples.asio.cpp20_coroutines Async functions with C++20 coroutines]
|
|
# [link async_mqtt5.examples.asio.futures Async functions with futures]
|
|
|
|
|
|
[section:callbacks Async functions with callbacks]
|
|
This example demonstrates how to use __Client__ asynchrous functions with callbacks.
|
|
|
|
[import ../../../example/callbacks.cpp]
|
|
[callbacks_examples]
|
|
[endsect]
|
|
|
|
[section:cpp20_coroutines Async functions with C++20 coroutines]
|
|
This example demonstrates how to use __Client__ asynchrous functions with C++20 coroutines
|
|
using __USE_AWAITABLE__ and __CO_SPAWN__.
|
|
|
|
[import ../../../example/cpp20_coroutines.cpp]
|
|
[cpp20_coroutines_examples]
|
|
[endsect]
|
|
|
|
[section:futures Async functions with futures]
|
|
This example demonstrates how to use __Client__ asynchrous functions with __USE_FUTURE__
|
|
completion token.
|
|
[import ../../../example/futures.cpp]
|
|
[futures_examples]
|
|
[endsect]
|
|
|
|
[endsect]
|