54 asio_ns::io_context &
ioctx )
62namespace pool_size_checking
87template<
typename Io_Context_Holder >
97 std::size_t pool_size,
102 ,
m_pool( pool_size_checking::ensure_pool_size_non_zero( pool_size ) )
122 "io_context_with_thread_pool is already started" };
132 std::thread{ [
this] {
133 auto work{ asio_ns::make_work_guard(
144 catch(
const std::exception & )
187 asio_ns::io_context &
Exception class for all exceptions thrown by RESTinio.
A class for holding a reference to external Asio's io_context.
external_io_context_for_thread_pool_t(asio_ns::io_context &ioctx)
Initializing constructor.
asio_ns::io_context & m_ioctx
auto & io_context() noexcept
Get access to io_context object.
asio_ns::io_context & io_context() noexcept
bool started() const noexcept
std::vector< std::thread > m_pool
~ioctx_on_thread_pool_t()
ioctx_on_thread_pool_t(const ioctx_on_thread_pool_t &)=delete
ioctx_on_thread_pool_t(ioctx_on_thread_pool_t &&)=delete
Io_Context_Holder m_ioctx_holder
ioctx_on_thread_pool_t(std::size_t pool_size, Io_Context_Holder_Ctor_Args &&...ioctx_holder_args)
A class for holding actual instance of Asio's io_context.
auto & io_context() noexcept
Get access to io_context object.
own_io_context_for_thread_pool_t()=default
asio_ns::io_context m_ioctx
std::size_t ensure_pool_size_non_zero(std::size_t pool_size)
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.