thread_creator.h 643 B

1234567891011121314151617181920
  1. #pragma once
  2. #include "backend_creator.h"
  3. #include <functional>
  4. class TOwningThreadedLogBackendCreator: public ILogBackendCreator {
  5. public:
  6. TOwningThreadedLogBackendCreator(THolder<ILogBackendCreator>&& slave);
  7. virtual bool Init(const IInitContext& ctx) override;
  8. virtual void ToJson(NJson::TJsonValue& value) const override;
  9. void SetQueueOverflowCallback(std::function<void()> callback);
  10. void SetQueueLen(size_t len);
  11. private:
  12. virtual THolder<TLogBackend> DoCreateLogBackend() const override;
  13. THolder<ILogBackendCreator> Slave;
  14. std::function<void()> QueueOverflowCallback = {};
  15. size_t QueueLen = 0;
  16. };