MayaFlux 0.4.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 325 of file Archivist.cpp.

326 {
327 while (auto entry = m_ring_buffer.pop()) {
328
329 std::lock_guard lock(m_mutex);
330 if (m_sinks.empty()) {
331 write_to_console(*entry);
332 } else {
333 write_to_sinks(*entry);
334 }
335 }
336
337 auto dropped = m_dropped_messages.exchange(0, std::memory_order_acquire);
338 if (dropped > 0) {
339 std::lock_guard lock(m_mutex);
340 std::cout << "[MayaFlux::Journal] WARNING: Dropped " << dropped
341 << " realtime log messages (buffer full)\n";
342 }
343 }
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: