2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-29 07:02:09 +00:00
Commit Graph

1006 Commits

Author SHA1 Message Date
Christopher Kohlhoff
43ecf63e14 Fix BOOST_ASIO_NO_EXCEPTIONS support. 2020-07-02 20:12:55 +10:00
Christopher Kohlhoff
fde31241ba Suppress conversion warning with MSVC. 2020-07-02 20:12:55 +10:00
Christopher Kohlhoff
af23cdc8e2 Fix compilation in MSVC's non-permissive mode. 2020-07-02 20:12:55 +10:00
Christopher Kohlhoff
b840adb353 Add bulk_execute() to thread_pool executor. 2020-07-02 00:24:34 +10:00
Christopher Kohlhoff
38514aca66 Add execution::bulk_execute customisation point object. 2020-07-02 00:23:04 +10:00
Christopher Kohlhoff
3a4f36b0ce Add adapter for execution::blocking_t::always_t. 2020-07-02 00:21:24 +10:00
Christopher Kohlhoff
9a1f89d748 Add adapter for execution::blocking_adaptation_t::allowed_t. 2020-07-02 00:17:51 +10:00
Christopher Kohlhoff
9fb152fd88 Limit variadic expansion for use_future's std::tuple support. 2020-07-01 14:00:08 +10:00
Christopher Kohlhoff
2ef33b429a Explicitly delete copy construction and assignment for derived socket classes. 2020-07-01 13:59:48 +10:00
Christopher Kohlhoff
cd1b1e2565 Add execution::context_t::polymorphic_query_result_type. 2020-07-01 13:59:22 +10:00
Christopher Kohlhoff
3c8097af00 Add execution::typed_sender concept and execution::is_typed_sender trait. 2020-07-01 13:58:58 +10:00
Christopher Kohlhoff
264772a351 Use correct allocator type in system_executor dispatch/post. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
4b3d8d96b2 Add missing equality_comparable trait for strand<>. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
07a35fea34 Add missing equality_comparable trait for execution::any_executor. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
46cee4fb0a Add missing equality_comparable trait for system_executor. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
57b0b6f231 Add missing equality_comparable trait for io_context executors. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
00248b6739 Add scheduler and sender support to thread_pool.
The thread_pool::basic_executor_type class template is used as the
implementation for both the scheduler and sender types.
2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
89392d98ae Make properties applicable to executors, senders, and schedulers. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
46e166e999 Fix documentation for execution::prefer_only. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
19c06f6931 Add execution::scheduler concept and execution::is_scheduler trait. 2020-06-30 22:39:08 +10:00
Christopher Kohlhoff
e93522cf35 Add execution::executor_index trait. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
49a3e6c628 Add execution::executor_shape trait. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
8081d7ee9d Add execution::schedule() customisation point object. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
75b2c02896 Add execution::execute() support for adapting senders. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
76789c2324 Add execution::submit() customisation point object. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
c27c6f2af8 Change execution::sender_traits to recognise executors as senders. 2020-06-30 22:38:09 +10:00
Christopher Kohlhoff
8437d73465 Add execution::sender_to concept and execution::is_sender_to trait. 2020-06-30 22:16:35 +10:00
Christopher Kohlhoff
7edcde3d97 Add execution::connect() customisation point object. 2020-06-30 22:15:35 +10:00
Christopher Kohlhoff
84bf100253 Add execution::receiver_invocation_error exception. 2020-06-30 22:09:54 +10:00
Christopher Kohlhoff
63d35468c0 Add execution::sender concepts and traits.
This change adds the concept:

  * execution::sender

the traits:

  * execution::sender_traits

and the tag type:

  * execution::sender_base

It also adds the following traits that correspond to the concepts:

  * execution::is_sender
2020-06-30 22:09:19 +10:00
Christopher Kohlhoff
4569c722ec Add execution::operation_state concept and execution::is_operation_state trait. 2020-06-30 22:08:19 +10:00
Christopher Kohlhoff
ca3a44ea3c Add execution::start() customisation point object. 2020-06-30 22:07:21 +10:00
Christopher Kohlhoff
36a811264d Add execution::executor_of concept and execution::is_executor trait. 2020-06-30 22:06:22 +10:00
Christopher Kohlhoff
4d8e791a8f Add execution::receiver concepts and traits.
This change adds the concepts:

  * execution::receiver
  * execution::receiver_of

and the trait:

  * execution::is_nothrow_receiver_of

It also adds the following traits that correspond to the concepts:

  * execution::is_receiver
  * execution::is_receiver_of
2020-06-30 22:02:21 +10:00
Christopher Kohlhoff
b68f15843c Add execution::set_value() customisation point object. 2020-06-30 21:55:37 +10:00
Christopher Kohlhoff
bd5acb1d51 Add execution::set_done() customisation point object. 2020-06-30 21:54:13 +10:00
Christopher Kohlhoff
3a22a4fb7b Add execution::set_error() customisation point object. 2020-06-30 21:52:51 +10:00
Christopher Kohlhoff
b51464b2ed Require gcc 4.8 or later to enable certain C++11 features.
When building with gcc, require version 4.8 or later to enable Asio's
support for the following C++11 features:

  * rvalue references and move support
  * variadic templates
  * constexpr
  * decltype
  * standard type traits
2020-06-30 21:50:08 +10:00
Christopher Kohlhoff
0689f316df Fix forward declaration guard used for any_executor. 2020-06-30 21:49:47 +10:00
Christopher Kohlhoff
45d52fb5ac Add standard executor support to basic_socket_acceptor accept() and async_accept(). 2020-06-26 15:46:15 +10:00
Christopher Kohlhoff
4ff016c025 More spawn() changes to support standard executors. 2020-06-26 15:45:55 +10:00
Christopher Kohlhoff
e6451028c3 Use a different target function table depending on the blocking property.
The any_executor class stores the state of the target's blocking
property to enable an optimisation in any_executor::execute(), i.e. if
the target executor has the property blocking.always, we can avoid a
memory allocation when type-erasing the submitted function object. With
this change the any_executor now "stores" the blocking property as a
different target function table, rather than as a separate member of
type blocking_t. This reduces the size of an any_executor by 8 bytes on
x86-64.
2020-06-26 15:44:47 +10:00
Christopher Kohlhoff
e2cde117c0 Add any_io_executor to forward declaration header 'netfwd.hpp'. 2020-06-24 20:07:00 +10:00
Christopher Kohlhoff
c06347a602 Documentation fix for the execution::allocator property. 2020-06-24 11:42:43 +10:00
Christopher Kohlhoff
242b3ee482 Disable executor_work_guard if BOOST_ASIO_NO_TS_EXECUTORS is defined. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
bb547e1a44 Disable io_context::strand if BOOST_ASIO_NO_TS_EXECUTORS is defined. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
307690de7f Disable asio::executor if BOOST_ASIO_NO_TS_EXECUTORS is defined. 2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
fefe9a992e Use properties to track outstanding work against an io_context.
When using standard executors, work is tracked by requiring (or
preferring) an executor with the execution::outstanding_work.tracked
property. This replaces executor_work_guard and make_work_guard() with
code of the form

    asio::io_context io_context;
    auto work = asio::require(io_context.get_executor(),
        asio::execution::outstanding_work.tracked);

To explicitly reset work, store the returned work-tracking executor in
an any_io_executor object:

    asio::any_io_executor work
      = asio::require(io_context.get_executor(),
          asio::execution::outstanding_work.tracked);

and then assign an empty executor into the object when done:

    work = asio::any_io_executor();
2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
5488c28a3b Use an any_executor<> as the polymorphic executor for I/O objects.
The asio::any_io_executor type alias has been added as the default
runtime-polymorphic executor for all I/O objects. This type alias points
to the execution::any_executor<> template with a set of supportable
properties specified for use with I/O.

If required for backward compatibility, BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
can be defined. This changes the asio::any_io_executor type alias to
point to the Networking TS-based runtime-polymorphic asio::executor
class instead.
2020-06-23 11:08:25 +10:00
Christopher Kohlhoff
9557f87ae4 Increase emulated variadic template support to 8 parameters. 2020-06-23 11:08:25 +10:00