5 #include <restinio/asio_include.hpp> 7 #include <restinio/exception.hpp> 54 asio_ns::io_context & ioctx )
70 throw exception_t{
"pool_size can't be 0" };
87 template<
typename Io_Context_Holder >
94 template<
typename... Io_Context_Holder_Ctor_Args >
97 std::size_t pool_size,
99 Io_Context_Holder_Ctor_Args && ...ioctx_holder_args )
122 "io_context_with_thread_pool is already started" };
std::size_t ensure_pool_size_non_zero(std::size_t pool_size)
asio_ns::io_context m_ioctx
auto & io_context() noexcept
Get access to io_context object.
external_io_context_for_thread_pool_t(asio_ns::io_context &ioctx)
Initializing constructor.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, std::optional< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in std::optional<Value_Type> if parameter exis...
A class for holding a reference to external Asio's io_context.
ioctx_on_thread_pool_t(ioctx_on_thread_pool_t &&)=delete
A class for holding actual instance of Asio's io_context.
auto & io_context() noexcept
Get access to io_context object.
ioctx_on_thread_pool_t(std::size_t pool_size, Io_Context_Holder_Ctor_Args &&...ioctx_holder_args)
~ioctx_on_thread_pool_t()
asio_ns::io_context & m_ioctx
own_io_context_for_thread_pool_t()=default
Io_Context_Holder m_ioctx_holder
ioctx_on_thread_pool_t(const ioctx_on_thread_pool_t &)=delete
bool started() const noexcept
asio_ns::io_context & io_context() noexcept
std::vector< std::thread > m_pool