Example #1
0
 def __init__(self, config, http=None):
     self._queue = queue.Queue(config.events_max_pending)
     self._flush_timer = RepeatingTimer(config.flush_interval, self.flush)
     self._users_flush_timer = RepeatingTimer(config.user_keys_flush_interval, self._flush_users)
     self._flush_timer.start()
     self._users_flush_timer.start()
     self._close_lock = Lock()
     self._closed = False
     EventDispatcher(self._queue, config, http)
Example #2
0
 def __init__(self, config, http=None, dispatcher_class=None):
     self._inbox = queue.Queue(config.events_max_pending)
     self._inbox_full = False
     self._flush_timer = RepeatingTimer(config.flush_interval, self.flush)
     self._users_flush_timer = RepeatingTimer(
         config.user_keys_flush_interval, self._flush_users)
     self._flush_timer.start()
     self._users_flush_timer.start()
     self._close_lock = Lock()
     self._closed = False
     (dispatcher_class or EventDispatcher)(self._inbox, config, http)
Example #3
0
    def __init__(self, config, http=None, dispatcher_class=None, diagnostic_accumulator=None):
        self._inbox = queue.Queue(config.events_max_pending)
        self._inbox_full = False
        self._flush_timer = RepeatingTimer(config.flush_interval, self.flush)
        self._users_flush_timer = RepeatingTimer(config.user_keys_flush_interval, self._flush_users)
        self._flush_timer.start()
        self._users_flush_timer.start()
        if diagnostic_accumulator is not None:
            self._diagnostic_event_timer = RepeatingTimer(config.diagnostic_recording_interval, self._send_diagnostic)
            self._diagnostic_event_timer.start()
        else:
            self._diagnostic_event_timer = None

        self._close_lock = Lock()
        self._closed = False

        (dispatcher_class or EventDispatcher)(self._inbox, config, http, diagnostic_accumulator)
 def __init__(self, resolved_paths, reloader, interval):
     self._paths = resolved_paths
     self._reloader = reloader
     self._file_times = self._check_file_times()
     self._timer = RepeatingTimer(interval, self._poll)
     self._timer.start()