Esempio n. 1
0
    def execute(self, request, pool, loglevel, logfile):
        if not self._pool:         # just take pool from first task.
            self._pool = pool

        state.task_ready(request)  # immediately remove from worker state.
        self._buffer.put(request)

        if self._tref is None:     # first request starts flush timer.
            self._tref = timer2.apply_interval(self.flush_interval * 1000,
                                               self._do_flush)

        if not self._count() % self.flush_every:
            self._do_flush()
Esempio n. 2
0
    def execute(self, request, pool, loglevel, logfile):
        if not self._pool:  # just take pool from first task.
            self._pool = pool

        state.task_ready(request)  # immediately remove from worker state.
        self._buffer.put(request)

        if self._tref is None:  # first request starts flush timer.
            self._tref = timer2.apply_interval(self.flush_interval * 1000,
                                               self._do_flush)

        if not self._count() % self.flush_every:
            self._do_flush()
Esempio n. 3
0
 def on_consume_ready(self, *args, **kwargs):
     print("INSTALLING TIMER")
     self.timers.append(apply_interval(self.flush_every * 1000,
                                       self.clicks.state.flush))
Esempio n. 4
0
 def install(self):
     self._tref = timer2.apply_interval(self.freq * 1000.0,
                                        self.capture)
     self._ctref = timer2.apply_interval(self.cleanup_freq * 1000.0,
                                         self.cleanup)
Esempio n. 5
0
 def on_consume_ready(self, *args, **kwargs):
     print("INSTALLING TIMER")
     self.timers.append(
         apply_interval(self.flush_every * 1000, self.clicks.state.flush))
Esempio n. 6
0
 def install(self):
     self._tref = timer2.apply_interval(self.freq * 1000.0,
                                        self.capture)
     self._ctref = timer2.apply_interval(self.cleanup_freq * 1000.0,
                                         self.cleanup)