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>
33 boost::asio::io_service
ios_;
36 boost::optional<boost::asio::io_service::work>
work_;
61 boost::asio::io_service&
79 template <
class... FN>
83 template <
class F0,
class... FN>
94 template <
class F0,
class... FN>
96 spawn(F0&& f, FN&&... fn);
99template <
class F0,
class... FN>
109template <
class F0,
class... FN>
121 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)