RESTinio
|
#include <ioctx_on_thread_pool.hpp>
Public Member Functions | |
ioctx_on_thread_pool_t (const ioctx_on_thread_pool_t &)=delete | |
ioctx_on_thread_pool_t (ioctx_on_thread_pool_t &&)=delete | |
template<typename... Io_Context_Holder_Ctor_Args> | |
ioctx_on_thread_pool_t (std::size_t pool_size, Io_Context_Holder_Ctor_Args &&...ioctx_holder_args) | |
~ioctx_on_thread_pool_t () | |
void | start () |
void | stop () noexcept |
void | wait () noexcept |
bool | started () const noexcept |
asio_ns::io_context & | io_context () noexcept |
Private Types | |
enum class | status_t : std::uint8_t { stopped , started } |
Private Attributes | |
Io_Context_Holder | m_ioctx_holder |
std::vector< std::thread > | m_pool |
status_t | m_status |
Helper class for creating io_context and running it (via io_context::run()
) on a thread pool.
io_context()
method). Expected usage scenario is to start and stop it on the same thread.Io_Context_Holder | A type which actually holds io_context object or a reference to an external io_context object. |
Definition at line 73 of file ioctx_on_thread_pool.hpp.
|
strongprivate |
Enumerator | |
---|---|
stopped | |
started |
Definition at line 180 of file ioctx_on_thread_pool.hpp.
|
delete |
|
delete |
|
inline |
Definition at line 80 of file ioctx_on_thread_pool.hpp.
|
inline |
Definition at line 93 of file ioctx_on_thread_pool.hpp.
|
inlinenoexcept |
Definition at line 174 of file ioctx_on_thread_pool.hpp.
|
inline |
Definition at line 103 of file ioctx_on_thread_pool.hpp.
|
inlinenoexcept |
Definition at line 171 of file ioctx_on_thread_pool.hpp.
|
inlinenoexcept |
Definition at line 146 of file ioctx_on_thread_pool.hpp.
|
inlinenoexcept |
Definition at line 159 of file ioctx_on_thread_pool.hpp.
|
private |
Definition at line 182 of file ioctx_on_thread_pool.hpp.
|
private |
Definition at line 183 of file ioctx_on_thread_pool.hpp.
|
private |
Definition at line 184 of file ioctx_on_thread_pool.hpp.