Exemple #1
0
 def create(self, w):
     if w.use_eventloop:
         # does not use dedicated timer thread.
         w.timer = _Timer(max_interval=10.0)
     else:
         if not w.timer_cls:
             # Default Timer is set by the pool, as for example, the
             # eventlet pool needs a custom timer implementation.
             w.timer_cls = w.pool_cls.Timer
         w.timer = self.instantiate(w.timer_cls,
                                    max_interval=w.timer_precision,
                                    on_error=self.on_timer_error,
                                    on_tick=self.on_timer_tick)
 def create(self, w):
     if w.use_eventloop:
         # does not use dedicated timer thread.
         w.timer = _Timer(max_interval=10.0)
     else:
         if not w.timer_cls:
             # Default Timer is set by the pool, as for example, the
             # eventlet pool needs a custom timer implementation.
             w.timer_cls = w.pool_cls.Timer
         w.timer = self.instantiate(w.timer_cls,
                                    max_interval=w.timer_precision,
                                    on_error=self.on_timer_error,
                                    on_tick=self.on_timer_tick)