jobqueue.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:mobot 作者: JokerQyou 项目源码 文件源码
def _main_loop(self):
        """
        Thread target of thread ``job_queue``. Runs in background and performs ticks on the job
        queue.

        """
        while self._running:
            # self._next_peek may be (re)scheduled during self.tick() or self.put()
            with self.__next_peek_lock:
                tmout = self._next_peek - time.time() if self._next_peek else None
                self._next_peek = None
                self.__tick.clear()

            self.__tick.wait(tmout)

            # If we were woken up by self.stop(), just bail out
            if not self._running:
                break

            self.tick()

        self.logger.debug('%s thread stopped', self.__class__.__name__)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号