

def _iterate(self, element):
    elements = [element]
    while True:
        try:
            new_element = self.queue.get_nowait()
            elements.append(new_element)
        except Queue.Empty:
            break
    if (not self.stopped):
        execute = True
        with self.period_lock:
            if ((time.time() - self._latest_update) <= self.next_period_between_updates):
                execute = False
            else:
                self._latest_update = time.time()
                self._update_period_between_updates()
        if execute:
            try:
                self.scheduler.update()
            except:
                log.log(SchedulerTransactionsSynchronizer, log.level.Critical, 'Exception updating scheduler')
                log.log_exc(SchedulerTransactionsSynchronizer, log.level.Critical)
    self._notify_elements(elements)

dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/core/coordinator/scheduler_transactions_synchronizer.py SchedulerTransactionsSynchronizer._iterate/original