MayaFlux 0.1.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 323 of file Archivist.cpp.

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