2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-22 13:42:08 +00:00
Commit Graph

100 Commits

Author SHA1 Message Date
Christopher Kohlhoff
2b237955b4 Add immediate completion to the overview. 2023-04-05 21:08:23 +10:00
Christopher Kohlhoff
67ad756f4e Add buffer literals to the documentation. 2023-04-05 21:08:23 +10:00
Christopher Kohlhoff
aba42faf19 Add co_composed to the overview. 2023-04-05 21:00:23 +10:00
Christopher Kohlhoff
e5abd8544c Add any_completion_handler to the overview. 2023-04-05 21:00:23 +10:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
3668ffb3c4 Add io_uring, updated Windows versions to implementation notes. 2022-12-07 20:37:59 +11:00
Christopher Kohlhoff
09716d71f3 Enabled deferred awaiting for coros, regularized use_coro, and fixed allocator handling.
This means that use_coro does not return a coro object, just like
use_awaitable does, i.e. it's an overhead that buys us type erasure.
Allocators can now be set for coro by including allocator_arg in the
coro signature.
2022-11-03 17:29:53 +11:00
Christopher Kohlhoff
5b4106c1a6 Add C++11 parallel_group example. 2022-11-01 11:00:16 +11:00
Christopher Kohlhoff
ed722fb0a3 Add consign completion token adapter.
The consign completion token adapter can be used to attach additional
values to a completion handler. This is typically used to keep at least
one copy of an object, such as a smart pointer, alive until the
completion handler is called.

For example:

  auto timer1 = std::make_shared<boost::asio::steady_timer>(my_io_context);
  timer1->expires_after(std::chrono::seconds(1));
  timer1->async_wait(
      boost::asio::consign(
        [](boost::system::error_code ec)
        {
          // ...
        },
        timer1
      )
    );

  auto timer2 = std::make_shared<boost::asio::steady_timer>(my_io_context);
  timer2->expires_after(std::chrono::seconds(30));
  std::future<void> f =
    timer2->async_wait(
      boost::asio::consign(
        boost::asio::use_future,
        timer2
      )
    );
2022-11-01 11:00:15 +11:00
Christopher Kohlhoff
46f49024e1 Removed all & race from promise - parallel_group covers most of it now. 2022-06-30 13:41:25 +10:00
Christopher Kohlhoff
5bbdc9b709 Change spawn() to be a completion token-based async operation.
Added new spawn() overloads that conform to the requirements for
asynchronous operations. These overloads also support cancellation. When
targeting C++11 and later these functions are implemented in terms of
Boost.Context directly.

The existing overloads have been retained but are deprecated.
2022-06-30 01:18:45 +10:00
Christopher Kohlhoff
4c216747dc Move deferred to the asio namespace.
This is no longer an experimental facility. The names deferred and
deferred_t have been temporarily retained as deprecated entities under
the asio::experimental namespace, for backwards compatibility.
2022-06-30 01:08:13 +10:00
Christopher Kohlhoff
34f5627723 Move prepend to the asio namespace.
This is no longer an experimental facility. The names prepend and
prepend_t have been temporarily retained as deprecated entities under
the asio::experimental namespace, for backwards compatibility.
2022-06-30 00:43:16 +10:00
Christopher Kohlhoff
f7356fbe90 Move append to the asio namespace.
This is no longer an experimental facility. The names append and
append_t have been temporarily retained as deprecated entities under
the asio::experimental namespace, for backwards compatibility.
2022-06-30 00:43:16 +10:00
Christopher Kohlhoff
a312a46715 Move as_tuple to the asio namespace.
This is no longer an experimental facility. The names as_tuple and
as_tuple_t have been temporarily retained as deprecated entities under
the asio::experimental namespace, for backwards compatibility.
2022-06-30 00:43:16 +10:00
Christopher Kohlhoff
e84f87060b Make experimental::deferred compatible with C++11. 2022-06-30 00:43:16 +10:00
Christopher Kohlhoff
a85fa9261c Add channels to the overview. 2022-04-06 23:40:40 +10:00
Christopher Kohlhoff
9dd4e2c90e Add experimental::promise to the overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
0944e620b9 Add async_compose to the overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
95fa2c3708 Update timer overview in terms of waitable timers. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
2d8df86af0 Add pipes to overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
aa540d1aa8 Add files to overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
61b48741cc Add completion token adapters to the overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
5e42c30397 Add experimental::parallel_group to the overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
fca5406f5e Add experimental::deferred to the overview. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
903bab8f3c Move 'Futures' to 'Composition and Completion Tokens' section. 2022-04-05 21:59:02 +10:00
Christopher Kohlhoff
d35b87ff27 Update documentation for dispatch, post, and defer. 2022-03-04 21:06:50 +11:00
Christopher Kohlhoff
8e69bf3cf3 Clarify the non-concurrency guarantees made for allocators. 2022-03-04 20:57:25 +11:00
Christopher Kohlhoff
e935ce35ce Document per-operation cancellation for serial ports. 2022-03-02 22:13:21 +11:00
Christopher Kohlhoff
4e163b8ac1 Add cancellation_slot support to signal sets. 2022-03-02 22:13:21 +11:00
Christopher Kohlhoff
9208208d11 Add overview of asynchronous model. 2022-03-02 22:13:21 +11:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
da52edb30f Add overview documentation for error handling with C++20 coroutines. 2021-11-17 08:41:51 +11:00
Christopher Kohlhoff
952eb39254 Clean up coro overview. 2021-11-17 08:41:29 +11:00
Christopher Kohlhoff
25f89c77e5 Add clarifications to concurrency hint documentation. 2021-11-17 08:40:07 +11:00
Christopher Kohlhoff
5b72b72b72 Improvements to asio::experimental::coro.
* Added overload so member functions can provide an explicit executor.
* Added co_spawn for coro tasks.
* Added reference and overview documentation.
* Adopted awaitable cancellation model.
* Refactored implementation.
2021-11-04 01:41:25 +11:00
Christopher Kohlhoff
b12ae3da40 Document per-operation cancellation for coroutines. 2021-08-05 10:31:54 +10:00
Christopher Kohlhoff
211c1a33c9 Add experimental::coro to overview. 2021-08-04 21:17:00 +10:00
Christopher Kohlhoff
481a1820a8 Add documentation for per-operation cancellation. 2021-08-04 20:38:17 +10:00
Christopher Kohlhoff
5ab0a54714 Update C++20 coroutines overview. 2021-08-04 20:38:17 +10:00
Christopher Kohlhoff
723982b867 Update copyright notices. 2021-02-25 08:29:05 +11:00
Christopher Kohlhoff
c034e3906f Clarify when the select reactor is used on Windows. 2020-11-02 14:03:09 +11:00
Christopher Kohlhoff
18deb3dc5f Document that there are multiple types of I/O execution context. 2020-08-05 22:54:41 +10:00
Christopher Kohlhoff
3f12308c03 Add overloads of co_spawn that launch an awaitable.
This change allows us to write:

 co_spawn(executor,
     echo(std::move(socket)),
     detached);

instead of:

 co_spawn(executor,
     [socket = std::move(socket)]() mutable
     {
       return echo(std::move(socket));
     },
     detached);
2020-06-22 20:49:30 +10:00
Christopher Kohlhoff
cb60b08ff5 Add source location support to handler tracking.
The BOOST_ASIO_HANDLER_LOCATION((file_name, line, function_name)) macro
may be used to inform the handler tracking mechanism of a source
location. This macro declares an object that is placed on the stack.

When an asynchronous operation is launched with location information, it
outputs lines using the <action> 'n^m', prior to the 'n*m' line that
signifies the beginning of the asynchronous operation. For example:

    @asio|1589423304.861944|>7|ec=system:0,bytes_transferred=5
    @asio|1589423304.861952|7^8|in 'async_write' (./../../../include/asio/impl/write.hpp:330)
    @asio|1589423304.861952|7^8|called from 'do_write' (handler_tracking/async_tcp_echo_server.cpp:62)
    @asio|1589423304.861952|7^8|called from 'operator()' (handler_tracking/async_tcp_echo_server.cpp:51)
    @asio|1589423304.861952|7*8|socket@0x7ff61c008230.async_send
    @asio|1589423304.861975|.8|non_blocking_send,ec=system:0,bytes_transferred=5
    @asio|1589423304.861980|<7|

If std::source_location or std::experimental::source_location are
available, the use_awaitable_t token (when default-constructed or used
as a default completion token) will also cause handler tracking to
output a source location for each newly created asynchronous operation.
A use_awaitable_t object may also be explicitly constructed with location
information.
2020-06-22 20:46:29 +10:00
Christopher Kohlhoff
70e2c7db78 Update overview to reflect that handlers are only required to be move constructible. 2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
62dad58386 Add ssl::host_name_verification.
The ssl::host_name_verification class is a drop-in replacement for
ssl::rfc2818_verification, which it supersedes. The
ssl::rfc2818_verification class has been marked as deprecated.

Thanks to Arvid Norberg for providing the implementation.
2020-04-07 11:44:28 +10:00
Christopher Kohlhoff
4b552cfd5b Update copyright notices. 2020-04-07 11:15:42 +10:00
Christopher Kohlhoff
5b6dc5ba74 Update diagrams to use io_context rather than io_service. 2019-12-05 00:34:39 +11:00
Christopher Kohlhoff
0cb51946bb Minor documentation fixes. 2019-12-03 19:59:09 +11:00