Class thl::Logger::rt::DrainThread#
-
class DrainThread#
A thread that drains a Queue periodically.
Runs at thl::core::ThreadPriority::Low by default: below UI work, but not starved like a background class would be, so delivery latency stays bounded by the interval. The destructor stops the thread, joins it and drains what arrived after its last pass; it must not run on the drain thread itself (i.e. from inside a sink callback).
Public Functions
-
~DrainThread() noexcept#
-
DrainThread(const DrainThread&) = delete#
-
DrainThread &operator=(const DrainThread&) = delete#
-
DrainThread(DrainThread&&) = delete#
-
DrainThread &operator=(DrainThread&&) = delete#
-
bool is_running() const noexcept#
-
bool is_current_thread() const noexcept#
True when called from the drain thread itself.
-
void set_interval_ms(std::uint32_t interval_ms) noexcept#
Change the drain interval of the running thread.
-
struct Options#
-
~DrainThread() noexcept#