forked from boostorg/beast
Refactor websocket::stream operations
This commit is contained in:
1 parent
6af6a8da99
commit
dfd08bf6ae
25 files changed
+1103
-914
No files matched your search
@@ -210,7 +210,7 @@ public:
|
||||
this parameter is optional and may be omitted.
|
||||
*/
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
template<class Handler>
|
||||
template<class Handler_>
|
||||
async_op_base(
|
||||
Handler&& handler,
|
||||
Executor1 const& ex1,
|
||||
|
||||
+41
-2
@@ -7,8 +7,8 @@
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#ifndef BOOST_BEAST_BIND_CONTINUATION_HPP
|
||||
#define BOOST_BEAST_BIND_CONTINUATION_HPP
|
||||
#ifndef BOOST_BEAST_DETAIL_BIND_CONTINUATION_HPP
|
||||
#define BOOST_BEAST_DETAIL_BIND_CONTINUATION_HPP
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
#include <boost/beast/core/detail/remap_post_to_defer.hpp>
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
namespace boost {
|
||||
namespace beast {
|
||||
namespace detail {
|
||||
|
||||
/** Mark a completion handler as a continuation.
|
||||
|
||||
@@ -29,6 +30,43 @@ namespace beast {
|
||||
function represents a continuation of the current asynchronous
|
||||
flow of control.
|
||||
|
||||
@param handler The handler to wrap.
|
||||
|
||||
@see
|
||||
|
||||
@li <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4242.html">[N4242] Executors and Asynchronous Operations, Revision 1</a>
|
||||
*/
|
||||
template<class CompletionHandler>
|
||||
#if BOOST_BEAST_DOXYGEN
|
||||
__implementation_defined__
|
||||
#else
|
||||
net::executor_binder<
|
||||
typename std::decay<CompletionHandler>::type,
|
||||
detail::remap_post_to_defer<
|
||||
net::associated_executor_t<CompletionHandler>>>
|
||||
#endif
|
||||
bind_continuation(CompletionHandler&& handler)
|
||||
{
|
||||
return net::bind_executor(
|
||||
detail::remap_post_to_defer<
|
||||
net::associated_executor_t<CompletionHandler>>(
|
||||
net::get_associated_executor(handler)),
|
||||
std::forward<CompletionHandler>(handler));
|
||||
}
|
||||
|
||||
/** Mark a completion handler as a continuation.
|
||||
|
||||
This function wraps a completion handler to associate it with an
|
||||
executor whose `post` operation is remapped to the `defer` operation.
|
||||
It is used by composed asynchronous operation implementations to
|
||||
indicate that a completion handler submitted to an initiating
|
||||
function represents a continuation of the current asynchronous
|
||||
flow of control.
|
||||
|
||||
@param ex The executor to use
|
||||
|
||||
@param handler The handler to wrap
|
||||
|
||||
@see
|
||||
|
||||
@li <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4242.html">[N4242] Executors and Asynchronous Operations, Revision 1</a>
|
||||
@@ -49,6 +87,7 @@ bind_continuation(
|
||||
std::forward<CompletionHandler>(handler));
|
||||
}
|
||||
|
||||
} // detail
|
||||
} // beast
|
||||
} // boost
|
||||
|
||||
Reference in new issue
Block a user