#include <thread_pool.hpp>
|
using | asio_callback = std::function< void(boost::system::error_code const &)> |
|
◆ taraxa::util::ThreadPool::Periodicity
struct taraxa::util::ThreadPool::Periodicity |
Class Members |
uint64_t |
delay_ms |
|
uint64_t |
period_ms |
|
◆ asio_callback
◆ ThreadPool() [1/3]
taraxa::util::ThreadPool::ThreadPool |
( |
size_t |
num_threads = std::thread::hardware_concurrency() , |
|
|
bool |
_start = true |
|
) |
| |
|
explicit |
◆ ~ThreadPool()
taraxa::util::ThreadPool::~ThreadPool |
( |
| ) |
|
◆ ThreadPool() [2/3]
taraxa::util::ThreadPool::ThreadPool |
( |
ThreadPool const & |
| ) |
|
|
delete |
◆ ThreadPool() [3/3]
taraxa::util::ThreadPool::ThreadPool |
( |
ThreadPool && |
| ) |
|
|
delete |
◆ capacity()
auto taraxa::util::ThreadPool::capacity |
( |
| ) |
const |
|
inline |
◆ is_running()
bool taraxa::util::ThreadPool::is_running |
( |
| ) |
const |
◆ num_pending_tasks()
uint64_t taraxa::util::ThreadPool::num_pending_tasks |
( |
| ) |
const |
|
inline |
◆ operator task_executor_t()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ post() [1/3]
template<typename Action >
auto taraxa::util::ThreadPool::post |
( |
Action && |
action | ) |
|
|
inline |
◆ post() [2/3]
void taraxa::util::ThreadPool::post |
( |
uint64_t |
do_in_ms, |
|
|
asio_callback |
action |
|
) |
| |
◆ post() [3/3]
void taraxa::util::ThreadPool::post |
( |
uint64_t |
err, |
|
|
std::function< void()> |
action |
|
) |
| |
◆ post_loop()
void taraxa::util::ThreadPool::post_loop |
( |
Periodicity const & |
periodicity, |
|
|
std::function< void()> |
action |
|
) |
| |
◆ start()
void taraxa::util::ThreadPool::start |
( |
| ) |
|
◆ stop()
void taraxa::util::ThreadPool::stop |
( |
| ) |
|
◆ unsafe_get_io_context()
auto& taraxa::util::ThreadPool::unsafe_get_io_context |
( |
| ) |
|
|
inline |
◆ ioc_
boost::asio::io_context taraxa::util::ThreadPool::ioc_ |
|
private |
◆ ioc_work_
boost::asio::executor_work_guard<decltype(ioc_)::executor_type> taraxa::util::ThreadPool::ioc_work_ |
|
private |
◆ num_pending_tasks_
std::atomic<uint64_t> taraxa::util::ThreadPool::num_pending_tasks_ = 0 |
|
private |
◆ threads_
std::vector<std::thread> taraxa::util::ThreadPool::threads_ |
|
private |
The documentation for this class was generated from the following files: