diff --git a/CHANGELOG.md b/CHANGELOG.md index db7ba1fe..217115be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ + +* New name for polymorphic executor. Trait for detecting new executors. * Handler invoke and allocation hooks are deprecated. -------------------------------------------------------------------------------- diff --git a/example/http/client/async-ssl/http_client_async_ssl.cpp b/example/http/client/async-ssl/http_client_async_ssl.cpp index 2a5f95bd..436af1fd 100644 --- a/example/http/client/async-ssl/http_client_async_ssl.cpp +++ b/example/http/client/async-ssl/http_client_async_ssl.cpp @@ -53,7 +53,7 @@ class session : public std::enable_shared_from_this public: explicit session( - net::executor ex, + net::any_io_executor ex, ssl::context& ctx) : resolver_(ex) , stream_(ex, ctx) diff --git a/include/boost/beast/core/async_base.hpp b/include/boost/beast/core/async_base.hpp index c5760308..5687aa02 100644 --- a/include/boost/beast/core/async_base.hpp +++ b/include/boost/beast/core/async_base.hpp @@ -182,7 +182,7 @@ class async_base #endif { static_assert( - net::is_executor::value, + net::is_executor::value || net::execution::is_executor::value, "Executor type requirements not met"); Handler h_; diff --git a/include/boost/beast/core/basic_stream.hpp b/include/boost/beast/core/basic_stream.hpp index bd7bbd77..7364f5a8 100644 --- a/include/boost/beast/core/basic_stream.hpp +++ b/include/boost/beast/core/basic_stream.hpp @@ -182,7 +182,7 @@ namespace beast { @tparam Executor A type meeting the requirements of Executor to be used for submitting all completion handlers which do not already have an - associated executor. If this type is omitted, the default of `net::executor` + associated executor. If this type is omitted, the default of `net::any_io_executor` will be used. @par Thread Safety @@ -197,7 +197,7 @@ namespace beast { */ template< class Protocol, - class Executor = net::executor, + class Executor = net::any_io_executor, class RatePolicy = unlimited_rate_policy > class basic_stream @@ -233,7 +233,8 @@ public: using endpoint_type = typename Protocol::endpoint; private: - static_assert(net::is_executor::value, + static_assert( + net::is_executor::value || net::execution::is_executor::value, "Executor type requirements not met"); struct impl_type diff --git a/include/boost/beast/core/detail/get_io_context.hpp b/include/boost/beast/core/detail/get_io_context.hpp index 27c816ea..7733b58e 100644 --- a/include/boost/beast/core/detail/get_io_context.hpp +++ b/include/boost/beast/core/detail/get_io_context.hpp @@ -56,7 +56,7 @@ get_io_context(net::strand const& ex) template< class T, class = typename std::enable_if< - std::is_same::value>::type> + std::is_same::value || std::is_same::value>::type> net::io_context* get_io_context(T const& ex) { diff --git a/include/boost/beast/core/tcp_stream.hpp b/include/boost/beast/core/tcp_stream.hpp index a96dd2ae..1b07c25a 100644 --- a/include/boost/beast/core/tcp_stream.hpp +++ b/include/boost/beast/core/tcp_stream.hpp @@ -25,7 +25,7 @@ namespace beast { */ using tcp_stream = basic_stream< net::ip::tcp, - net::executor, + net::any_io_executor, unlimited_rate_policy>; } // beast diff --git a/test/beast/core/_detail_get_io_context.cpp b/test/beast/core/_detail_get_io_context.cpp index 1ee977fe..95aa54d8 100644 --- a/test/beast/core/_detail_get_io_context.cpp +++ b/test/beast/core/_detail_get_io_context.cpp @@ -32,13 +32,13 @@ public: BEAST_EXPECT(get_io_context(ioc) == &ioc); BEAST_EXPECT(get_io_context(ioc.get_executor()) == &ioc); BEAST_EXPECT(get_io_context(net::make_strand(ioc)) == &ioc); - BEAST_EXPECT(get_io_context(net::executor(ioc.get_executor())) == &ioc); + BEAST_EXPECT(get_io_context(net::any_io_executor(ioc.get_executor())) == &ioc); #if 0 // VFALCO FIXME BEAST_EXPECT( get_io_context( - net::strand( - net::executor(ioc.get_executor()))) == &ioc); + net::strand( + net::any_io_executor(ioc.get_executor()))) == &ioc); #endif } diff --git a/test/beast/core/basic_stream.cpp b/test/beast/core/basic_stream.cpp index efca5cc3..a48971ef 100644 --- a/test/beast/core/basic_stream.cpp +++ b/test/beast/core/basic_stream.cpp @@ -43,12 +43,12 @@ namespace beast { #if 0 template class basic_stream< net::ip::tcp, - net::executor, + net::any_io_executor, unlimited_rate_policy>; template class basic_stream< net::ip::tcp, - net::executor, + net::any_io_executor, simple_rate_policy>; #endif diff --git a/test/beast/core/make_strand.cpp b/test/beast/core/make_strand.cpp index b356c8eb..fa06276d 100644 --- a/test/beast/core/make_strand.cpp +++ b/test/beast/core/make_strand.cpp @@ -28,7 +28,7 @@ public: net::make_strand(ioc.get_executor()); net::make_strand(net::make_strand(ioc)); - net::executor ex(ioc.get_executor()); + net::any_io_executor ex(ioc.get_executor()); net::make_strand(ex); // this *should-not* compile diff --git a/test/beast/websocket/ping.cpp b/test/beast/websocket/ping.cpp index 2647ae39..0bfb5586 100644 --- a/test/beast/websocket/ping.cpp +++ b/test/beast/websocket/ping.cpp @@ -378,7 +378,7 @@ public: using socket_type = net::basic_stream_socket< net::ip::tcp, - net::executor>; + net::any_io_executor>; net::io_context ioc; stream ws1(ioc); stream ws2(ioc); diff --git a/test/beast/websocket/ssl.cpp b/test/beast/websocket/ssl.cpp index cbb64eea..e7d58b35 100644 --- a/test/beast/websocket/ssl.cpp +++ b/test/beast/websocket/ssl.cpp @@ -62,7 +62,7 @@ public: boost::asio::ssl::stream< boost::asio::basic_stream_socket< boost::asio::ip::tcp, - boost::asio::executor>>>(); + net::any_io_executor>>>(); } }; diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 8b15dde5..d0e18196 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -288,7 +288,7 @@ struct associated_allocator template struct associated_executor { - using type = boost::asio::executor; + using type = boost::asio::any_io_executor; static type diff --git a/test/doc/core_3_timeouts.cpp b/test/doc/core_3_timeouts.cpp index f6eb5907..5da9eb51 100644 --- a/test/doc/core_3_timeouts.cpp +++ b/test/doc/core_3_timeouts.cpp @@ -205,7 +205,7 @@ core_3_timeouts_snippets() // if the choice of RatePolicy is not DefaultConstructible, // an instance of the type may be passed to the constructor. - basic_stream stream(ioc); + basic_stream stream(ioc); // The policy object, which is default constructed, or // decay-copied upon construction, is attached to the stream @@ -586,7 +586,7 @@ core_3_timeouts_snippets2() //[code_core_3_timeouts_9 // This stream will use our new rate_gauge policy - basic_stream stream(ioc); + basic_stream stream(ioc); //... @@ -600,7 +600,7 @@ core_3_timeouts_snippets2() } // (anon) -template class basic_stream; +template class basic_stream; struct core_3_timeouts_test : public beast::unit_test::suite