#pragma once #include #include "logging/log.hpp" #include "data_structures/queue/mpsc_queue.hpp" class AsyncLog : public Log { public: ~AsyncLog(); protected: void emit(Record::uptr) override; std::string type() override; private: lockfree::MpscQueue records; std::atomic alive {true}; std::thread worker {[this]() { work(); }}; void work(); };