forked from boostorg/beast
immediate_executor is supported. (#2672)
This commit is contained in:
1 parent
177a1222a6
commit
dd875463ff
25 files changed
+475
-219
No files matched your search
@@ -244,8 +244,13 @@ public:
|
||||
__FILE__, __LINE__,
|
||||
"http::async_read_some"));
|
||||
|
||||
net::post(
|
||||
s_.get_executor(),
|
||||
|
||||
const auto ex =
|
||||
asio::get_associated_immediate_executor(
|
||||
self, s_.get_executor());
|
||||
|
||||
net::dispatch(
|
||||
ex,
|
||||
beast::bind_front_handler(std::move(self), ec));
|
||||
}
|
||||
}
|
||||
@@ -285,7 +290,11 @@ public:
|
||||
__FILE__, __LINE__,
|
||||
"http::async_read"));
|
||||
|
||||
net::post(s_.get_executor(), std::move(self));
|
||||
const auto ex =
|
||||
asio::get_associated_immediate_executor(
|
||||
self, s_.get_executor());
|
||||
|
||||
net::dispatch(ex, std::move(self));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/beast/core/stream_traits.hpp>
|
||||
#include <boost/beast/core/detail/is_invocable.hpp>
|
||||
#include <boost/asio/coroutine.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/write.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
@@ -102,8 +102,9 @@ public:
|
||||
__FILE__, __LINE__,
|
||||
"http::async_write_some"));
|
||||
|
||||
return net::post(
|
||||
s_.get_executor(),
|
||||
auto ex = asio::get_associated_immediate_executor(*this, s_.get_executor());
|
||||
return net::dispatch(
|
||||
ex,
|
||||
beast::bind_front_handler(
|
||||
std::move(*this), ec, 0));
|
||||
}
|
||||
@@ -120,8 +121,9 @@ public:
|
||||
__FILE__, __LINE__,
|
||||
"http::async_write_some"));
|
||||
|
||||
return net::post(
|
||||
s_.get_executor(),
|
||||
const auto ex = this->get_immediate_executor();
|
||||
return net::dispatch(
|
||||
ex,
|
||||
beast::bind_front_handler(
|
||||
std::move(*this), ec, 0));
|
||||
}
|
||||
@@ -219,8 +221,9 @@ public:
|
||||
__FILE__, __LINE__,
|
||||
"http::async_write"));
|
||||
|
||||
net::post(
|
||||
s_.get_executor(),
|
||||
const auto ex = this->get_immediate_executor();
|
||||
net::dispatch(
|
||||
ex,
|
||||
std::move(*this));
|
||||
}
|
||||
goto upcall;
|
||||
|
||||
Reference in new issue
Block a user