2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-20 04:22:10 +00:00

13 Commits

Author SHA1 Message Date
Christopher Kohlhoff
84c45dbe48 Add inline_executor. 2025-10-29 22:58:47 +11:00
Christopher Kohlhoff
cd2b1b37ff Fix compilation errors in channel<void(error_code)>. 2025-08-05 08:09:27 +10:00
Christopher Kohlhoff
1afbc5c12b Update copyright notices. 2025-03-04 22:57:26 +11:00
Christopher Kohlhoff
c36d3ef338 Update copyright notices. 2024-03-05 07:51:17 +11:00
Christopher Kohlhoff
77bc08c046 Fix compatibility between experimental::channel and any_completion_handler. 2023-11-07 23:20:05 +11:00
Christopher Kohlhoff
e1d4890f02 Add support for two channel payload signatures with c++11. 2023-11-01 23:12:14 +11:00
Christopher Kohlhoff
08b8c3cec3 Add try_send_via_dispatch/try_send_n_via_dispatch functions to channels. 2023-11-01 23:12:14 +11:00
Christopher Kohlhoff
d6a4d3b898 Add interoperability between channels and associated_immediate_executor. 2023-03-08 21:05:44 +11:00
Christopher Kohlhoff
730441dcbb Ensure buffered messages can still be received when channel is closed. 2023-03-06 23:37:39 +11:00
Christopher Kohlhoff
35e93e4e90 Update copyright notices. 2023-03-01 23:03:03 +11:00
Christopher Kohlhoff
68ef2b45d4 Add channel buffer specialisation for R(error_code). 2022-11-01 11:35:07 +11:00
Christopher Kohlhoff
ff58013a23 Update copyright notices. 2022-03-02 21:23:52 +11:00
Christopher Kohlhoff
495e6367af Add experimental support for channels.
This adds experimental::channel and experimental::concurrent_channel.
Channels may be used to send completions as messages. For example:

  // Create a channel with no buffer space.
  channel<void(error_code, size_t)> ch(ctx);

  // The call to try_send fails as there is no buffer
  // space and no waiting receive operations.
  bool ok = ch.try_send(asio::error::eof, 123);
  assert(!ok);

  // The async_send operation blocks until a receive
  // operation consumes the message.
  ch.async_send(asio::error::eof, 123,
      [](error_code ec)
      {
        // ...
      });

  // The async_receive consumes the message. Both the
  // async_send and async_receive operations complete
  // immediately.
  ch.async_receive(
      [](error_code ec, size_t n)
      {
        // ...
      });
2021-11-04 01:56:32 +11:00