MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ drain_ring_buffer()

void MayaFlux::Journal::Archivist::Impl::drain_ring_buffer ( )
inlineprivate

Definition at line 319 of file Archivist.cpp.

320 {
321 while (auto entry = m_ring_buffer.pop()) {
322
323 std::lock_guard lock(m_mutex);
324 if (m_sinks.empty()) {
325 write_to_console(*entry);
326 } else {
327 write_to_sinks(*entry);
328 }
329 }
330
331 auto dropped = m_dropped_messages.exchange(0, std::memory_order_acquire);
332 if (dropped > 0) {
333 std::lock_guard lock(m_mutex);
334 std::cout << "[MayaFlux::Journal] WARNING: Dropped " << dropped
335 << " realtime log messages (buffer full)\n";
336 }
337 }
Memory::LockFreeQueue< RealtimeEntry, RING_BUFFER_SIZE > m_ring_buffer
static void write_to_console(const JournalEntry &entry)
std::vector< std::unique_ptr< Sink > > m_sinks
std::atomic< uint64_t > m_dropped_messages
void write_to_sinks(const JournalEntry &entry)

References m_dropped_messages, m_mutex, m_ring_buffer, m_sinks, write_to_console(), and write_to_sinks().

Referenced by shutdown(), stop_worker(), and worker_loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: