allocate & invoke hooks are removed.

This commit is contained in:
Klemens Morgenstern
2023-10-26 11:23:03 +08:00
committed by Mohammad Nejati
parent a7927988ea
commit 3996cae768
10 changed files with 9 additions and 219 deletions

View File

@@ -50,8 +50,8 @@ composed operations:
This class is designed to be used as a base class when authoring
composed asynchronous operations expressed as an intermediate
completion handler. This eliminates the need for the extensive
boilerplate to propagate the associated executor, associated
allocator, and legacy completion handler hooks.
boilerplate to propagate the associated executor and the associated
allocator.
]]
[[
[link beast.ref.boost__beast__allocate_stable `allocate_stable`]

View File

@@ -34,7 +34,7 @@ The implementation strategy is to make the composed object meet the
requirements of a completion handler by being movable, and by making it
invocable so it can be used as a continuation for the asynchronous operations
it launches. Rather than using `std::bind` or `boost::bind`, which destroys
the type information and therefore breaks the allocation and invocation hooks,
the type information and therefore breaks the associators,
we will simply pass `std::move(*this)` as the completion handler parameter for
any operations that we initiate. For the move to work correctly, care must be
taken to ensure that no access to data members are made after the move takes

View File

@@ -118,7 +118,7 @@ access. In contrast, Beast does not use mutexes anywhere in its
implementation. Instead, it follows the Asio pattern. Calls to
asynchronous initiation functions use the same method to invoke
intermediate handlers as the method used to invoke the final handler,
through the __asio_handler_invoke__ mechanism.
through the associated executor mechanism.
The only requirement in Beast is that calls to asynchronous initiation
functions are made from the same implicit or explicit strand. For
@@ -131,14 +131,6 @@ costs associated with mutexes are incurred.
[[@https://github.com/vinniefalco/Beast/blob/6c8b4b2f8dde72b01507e4ac7fde4ffea57ebc99/include/beast/websocket/impl/read_frame_op.ipp#L118 Beast]]
[[@https://github.com/zaphoyd/websocketpp/blob/378437aecdcb1dfe62096ffd5d944bf1f640ccc3/websocketpp/transport/iostream/connection.hpp#L706 websocketpp]]
][
[```
template <class Function>
friend
void asio_handler_invoke(Function&& f, read_frame_op* op)
{
return boost_asio_handler_invoke_helpers::invoke(f, op->d_->h);
}
```]
[```
mutex_type m_read_mutex;
```]
@@ -156,9 +148,9 @@ Boost.Asio. They are function objects which can be copied or moved but
most importantly they are not type erased. The compiler can see
through the type directly to the implementation, permitting
optimization. Furthermore, Beast follows the Asio rules for treatment
of handlers. It respects any allocation, continuation, or invocation
customizations associated with the handler through the use of argument
dependent lookup overloads of functions such as `asio_handler_allocate`.
of handlers. It respects any allocation, executors, cancellations
associated with the handler through the use of argument
dependent lookup overloads of functions such as `bind_allocaotr`.
The Beast completion handler is provided at the call site. For each
call to an asynchronous initiation function, it is guaranteed that

View File

@@ -43,8 +43,6 @@
[/ Networking Identifiers ]
[def __asio_handler_allocate__ [@boost:/doc/html/boost_asio/reference/asio_handler_allocate.html `asio_handler_allocate`]]
[def __asio_handler_invoke__ [@boost:/doc/html/boost_asio/reference/asio_handler_invoke.html `asio_handler_invoke`]]
[def __basic_stream_socket__ [@boost:/doc/html/boost_asio/reference/basic_stream_socket.html `basic_stream_socket`]]
[def __const_buffer__ [@boost:/doc/html/boost_asio/reference/const_buffer.html `const_buffer`]]
[def __deduced__ [@boost:/doc/html/boost_asio/reference/asynchronous_operations.html#boost_asio.reference.asynchronous_operations.automatic_deduction_of_initiating_function_return_type ['DEDUCED]]]

View File

@@ -196,7 +196,7 @@
* The API to Asio has undergone changes. Please refer to the Asio release notes for details.
* Beast has been updated to track and respect developer choices in the use of Asio. In particular:
* Define `BOOST_ASIO_NO_DEPRECATED` to disallow deprecated invocation and allocation hooks.
* Define `BOOST_ASIO_NO_DEPRECATED` to disallow deprecated invocation hooks.
* Define `BOOST_ASIO_NO_TS_EXECUTORS` to ensure that executors conform to the
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0443r11.html Standard Executors] proposal.
* Define `BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT` to select