6#ifndef SPDLOG_HEADER_ONLY
19 if (threads_n == 0 || threads_n > 1000)
21 throw_spdlog_ex(
"spdlog::thread_pool(): invalid threads_n param (valid "
24 for (
size_t i = 0; i < threads_n; i++)
105 switch (incoming_async_msg.
msg_type)
108 incoming_async_msg.
worker_ptr->backend_sink_it_(incoming_async_msg);
112 incoming_async_msg.
worker_ptr->backend_flush_();
void enqueue_nowait(T &&item)
bool dequeue_for(T &popped_item, std::chrono::milliseconds wait_duration)
void post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy)
thread_pool(size_t q_max_items, size_t threads_n, std::function< void()> on_thread_start)
void post_async_msg_(async_msg &&new_msg, async_overflow_policy overflow_policy)
void post_flush(async_logger_ptr &&worker_ptr, async_overflow_policy overflow_policy)
std::vector< std::thread > threads_
T emplace_back(T... args)
SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno)
async_logger_ptr worker_ptr