8#ifndef BEAST_TEST_YIELD_TO_HPP
9#define BEAST_TEST_YIELD_TO_HPP
11#include <boost/asio/io_service.hpp>
12#include <boost/asio/spawn.hpp>
13#include <boost/optional.hpp>
32 boost::asio::io_service
ios_;
35 boost::optional<boost::asio::io_service::work>
work_;
60 boost::asio::io_service&
78 template <
class... FN>
82 template <
class F0,
class... FN>
93 template <
class F0,
class... FN>
95 spawn(F0&& f, FN&&... fn);
98template <
class F0,
class... FN>
108template <
class F0,
class... FN>
120 boost::coroutines::attributes(2 * 1024 * 1024));
Mix-in to support tests using asio coroutines.
enable_yield_to(std::size_t concurrency=1)
boost::asio::yield_context yield_context
The type of yield context passed to functions.
std::condition_variable cv_
void yield_to(F0 &&f0, FN &&... fn)
Run one or more functions, each in a coroutine.
boost::optional< boost::asio::io_service::work > work_
boost::asio::io_service & get_io_service()
Return the io_service associated with the object.
std::vector< std::thread > threads_
boost::asio::io_service ios_
T emplace_back(T... args)