public EventLoggerThread(Queue <Event> queue, EventsWriter ev_writer, int flush_secs, Event sentinel_event) { daemon = true; _queue = queue; _ev_writer = ev_writer; _flush_secs = flush_secs; _sentinel_event = sentinel_event; }
public EventFileWriter(string logdir, int max_queue = 10, int flush_secs = 120, string filename_suffix = null) { _logdir = logdir; Directory.CreateDirectory(_logdir); _event_queue = new Queue <Event>(max_queue); _ev_writer = new EventsWriter(Path.Combine(_logdir, "events")); _flush_secs = flush_secs; _sentinel_event = new Event(); if (!string.IsNullOrEmpty(filename_suffix)) { // self._ev_writer.InitWithSuffix(compat.as_bytes(filename_suffix))) throw new NotImplementedException("EventFileWriter filename_suffix is not null"); } _closed = false; _worker = new EventLoggerThread(_event_queue, _ev_writer, _flush_secs, _sentinel_event); _worker.start(); }