quill
Public Member Functions | List of all members
ManualBackendWorker Class Reference

This class can be used when you want to run the backend worker on your own thread. More...

#include <ManualBackendWorker.h>

Public Member Functions

 ManualBackendWorker (detail::BackendWorker *backend_worker)
 
void init (BackendOptions options)
 Initializes the ManualBackendWorker with the specified backend options. More...
 
void poll_one ()
 Polls all thread-local SPSC queues and caches the log statements, processing and writing the log statement with the minimum timestamp to the corresponding output sinks. More...
 
void poll ()
 Continuously polls the backend worker until all queues are empty. More...
 
void poll (std::chrono::microseconds timeout)
 This function behaves like poll() but will stop polling if the specified timeout duration is reached before all queues are emptied. More...
 

Detailed Description

This class can be used when you want to run the backend worker on your own thread.

Member Function Documentation

◆ init()

void ManualBackendWorker::init ( BackendOptions  options)
inline

Initializes the ManualBackendWorker with the specified backend options.

This function must be called before any other functions in this class. It configures the backend worker for manual operation, disabling certain options that are incompatible with manual control.

Parameters
optionsThe BackendOptions to configure the backend worker.

◆ poll() [1/2]

void ManualBackendWorker::poll ( )
inline

Continuously polls the backend worker until all queues are empty.

This function keeps polling until all frontend queues and cached transit events are processed.

◆ poll() [2/2]

void ManualBackendWorker::poll ( std::chrono::microseconds  timeout)
inline

This function behaves like poll() but will stop polling if the specified timeout duration is reached before all queues are emptied.

This can be useful when you want to limit the time spent processing log statements.

◆ poll_one()

void ManualBackendWorker::poll_one ( )
inline

Polls all thread-local SPSC queues and caches the log statements, processing and writing the log statement with the minimum timestamp to the corresponding output sinks.

This function should be called periodically by the thread to process and dispatch log entries. It assumes that the init() function has been called first to properly configure the backend worker.


The documentation for this class was generated from the following file: