#include <swcdb/core/comm/IoContext.h>
Public Types | |
typedef asio::thread_pool::executor_type | Executor |
typedef asio::executor_work_guard< Executor > | ExecutorWorkGuard |
Public Member Functions | |
IoContext (std::string &&_name, int32_t size) | |
~IoContext () noexcept | |
SWC_CAN_INLINE int32_t | get_size () const noexcept |
SWC_CAN_INLINE Executor | executor () noexcept |
template<typename T_Handler > | |
SWC_CAN_INLINE void | post (T_Handler &&handler) |
void | set_signals () |
void | set_periodic_timer (const Config::Property::Value_int32_g::Ptr ms, PeriodicTimer::Call_t &&call) |
void | stop () |
Static Public Member Functions | |
static IoContextPtr | make (std::string &&_name, int32_t size) |
static SWC_CAN_INLINE uint32_t | get_number_of_threads (bool relative, int32_t size) noexcept |
static IoContextPtr | make (std::string &&_name, bool relative, int32_t size) |
Public Attributes | |
Core::AtomicBool | running |
const std::string | name |
asio::thread_pool | pool |
std::unique_ptr< asio::signal_set > | signals |
Private Attributes | |
int32_t | m_size |
PeriodicTimers | m_periodic_timers |
Definition at line 35 of file IoContext.h.
typedef asio::thread_pool::executor_type SWC::Comm::IoContext::Executor |
Definition at line 38 of file IoContext.h.
typedef asio::executor_work_guard<Executor> SWC::Comm::IoContext::ExecutorWorkGuard |
Definition at line 39 of file IoContext.h.
SWC::Comm::IoContext::IoContext | ( | std::string && | _name, |
int32_t | size | ||
) |
Definition at line 12 of file IoContext.cc.
References SWC::LOG_DEBUG, m_size, name, SWC_ASSERT, and SWC_LOGF.
Referenced by make().
|
inlinenoexcept |
Definition at line 72 of file IoContext.h.
|
inlinenoexcept |
Definition at line 80 of file IoContext.h.
References pool.
Referenced by set_signals(), and stop().
|
inlinestaticnoexcept |
Definition at line 47 of file IoContext.h.
References size.
Referenced by SWC::FS::FileSystemHadoop::initialize(), and make().
|
inlinenoexcept |
Definition at line 75 of file IoContext.h.
References m_size.
|
inlinestatic |
Definition at line 55 of file IoContext.h.
References get_number_of_threads(), IoContext(), and size.
|
inlinestatic |
Definition at line 41 of file IoContext.h.
References IoContext(), and size.
Referenced by SWC::Manager::AppContext::AppContext(), SWC::Broker::AppContext::make(), SWC::Ranger::AppContext::make(), run(), and SWC::Comm::server::SerializedServer::SerializedServer().
|
inline |
Definition at line 89 of file IoContext.h.
References pool.
void SWC::Comm::IoContext::set_periodic_timer | ( | const Config::Property::Value_int32_g::Ptr | ms, |
PeriodicTimer::Call_t && | call | ||
) |
Definition at line 24 of file IoContext.cc.
References m_periodic_timers, and SWC::Comm::PeriodicTimers::set().
void SWC::Comm::IoContext::set_signals | ( | ) |
Definition at line 20 of file IoContext.cc.
References executor(), and signals.
void SWC::Comm::IoContext::stop | ( | ) |
Definition at line 30 of file IoContext.cc.
References executor(), SWC::LOG_DEBUG, m_periodic_timers, name, pool, running, SWC::Comm::PeriodicTimers::stop(), SWC::Core::AtomicBase< T, OrderT >::store(), and SWC_LOGF.
|
private |
Definition at line 103 of file IoContext.h.
Referenced by set_periodic_timer(), and stop().
|
private |
Definition at line 102 of file IoContext.h.
Referenced by get_size(), and IoContext().
const std::string SWC::Comm::IoContext::name |
Definition at line 65 of file IoContext.h.
Referenced by IoContext(), and stop().
asio::thread_pool SWC::Comm::IoContext::pool |
Definition at line 66 of file IoContext.h.
Referenced by executor(), post(), and stop().
Core::AtomicBool SWC::Comm::IoContext::running |
Definition at line 64 of file IoContext.h.
Referenced by stop().
std::unique_ptr<asio::signal_set> SWC::Comm::IoContext::signals |
Definition at line 67 of file IoContext.h.
Referenced by set_signals().