Use strand<> rather than legacy executor io_context::strand

This commit is contained in:
Christopher Kohlhoff
2020-06-23 11:26:44 +10:00
committed by Richard Hodges
parent aef2559c7a
commit 06a0b18b1d
3 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
* Use strand<> rather than legacy executor io_context::strand.
* Use dispatch/post free functions to be independent of executor concept.
* New name for polymorphic executor. Trait for detecting new executors.
* Handler invoke and allocation hooks are deprecated.

View File

@@ -82,7 +82,7 @@ class frame_test;
To declare the @ref stream object with a @ref tcp_stream in a
multi-threaded asynchronous program using a strand, you may write:
@code
websocket::stream<tcp_stream> ws{net::io_context::strand(ioc)};
websocket::stream<tcp_stream> ws{net::make_strand(ioc)};
@endcode
Alternatively, for a single-threaded or synchronous application
you may write:

View File

@@ -331,8 +331,8 @@ class basic_stream_test
{
public:
using tcp = net::ip::tcp;
using strand = net::io_context::strand;
using executor = net::io_context::executor_type;
using strand = net::strand<executor>;
//--------------------------------------------------------------------------
@@ -372,7 +372,7 @@ public:
// net::io_context::strand
{
auto ex = strand{ioc};
auto ex = net::make_strand(ioc);
basic_stream<tcp, strand> s1(ex);
basic_stream<tcp, strand> s2(ex, tcp::v4());
basic_stream<tcp, strand> s3(std::move(s1));
@@ -392,11 +392,11 @@ public:
test_sync_stream<
basic_stream<
tcp, net::io_context::strand>>();
tcp, strand>>();
test_async_stream<
basic_stream<
tcp, net::io_context::strand>>();
tcp, strand>>();
}
// construction from existing socket