A queue for storing log entries with thread-safe operations.
More...
#include <log_queue.h>
|
| LogQueue (uint64_t queueMaxSize) |
|
bool | insert (proto::LogEntry *item) |
| Inserts a log entry into the queue. If the queue is full, it replaces the last item in the queue. This method does not wait and handles the insertion or replacement immediately.
|
|
bool | fetch_all (std::vector< proto::LogEntry * > &refFetchedItems) |
| Fetches all log entries from the queue.
|
|
void | stop () |
| Stops the queue. This will unblock all waiting threads and prevent further operations.
|
|
bool | is_stopped () |
| Checks if the queue has been stopped.
|
|
A queue for storing log entries with thread-safe operations.
This class implements a bounded queue that supports thread-safe insertion and fetching of log entries.
◆ LogQueue()
yarilo::LogQueue::LogQueue |
( |
uint64_t | queueMaxSize | ) |
|
|
inline |
Constructs a LogQueue with a specified maximum size.
- Parameters
-
[in] | queueMaxSize | Maximum size of the log queue. |
◆ fetch_all()
bool yarilo::LogQueue::fetch_all |
( |
std::vector< proto::LogEntry * > & | refFetchedItems | ) |
|
|
inline |
Fetches all log entries from the queue.
- Parameters
-
[out] | refFetchedItems | Reference to a vector that will store fetched entries. |
- Returns
- True if fetching was successful, false if stopped
◆ insert()
bool yarilo::LogQueue::insert |
( |
proto::LogEntry * | item | ) |
|
|
inline |
Inserts a log entry into the queue. If the queue is full, it replaces the last item in the queue. This method does not wait and handles the insertion or replacement immediately.
- Parameters
-
[in] | item | Pointer to the log entry to be inserted. |
- Returns
- True if the insertion was successful.
◆ is_stopped()
bool yarilo::LogQueue::is_stopped |
( |
| ) |
|
|
inline |
Checks if the queue has been stopped.
- Returns
- True if the queue is stopped, otherwise false.
◆ stop()
void yarilo::LogQueue::stop |
( |
| ) |
|
|
inline |
Stops the queue. This will unblock all waiting threads and prevent further operations.
The documentation for this class was generated from the following file:
- /tmp/nix-build-Yarilo-0.9.9.drv-0/backend/src/log_queue.h