I'd like to serialize http post requests using strand, to avoid overlapping writes to network.
My approach was to call the post
method from the strand
object with the callback that send the data as can be shown in the following code :
void Send(
boost::beast::http::request<boost::beast::http::string_body> &req) {
strand_.post([=]() {
...
boost::beast::http::write(stream_, req);
...
}
However, from looking at some examples, I've noticed 2 types of strand definitions :
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
boost::asio::io_context::strand strand_;
Any idea what's the different between each type ?