main.py 文件源码

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

项目:eventor 作者: Acrisel 项目源码 文件源码
def run(self,  max_loops=-1):
        ''' loops events structures to execute raise events and execute tasks.

        Args:
            max_loops: number of loops to run.  If positive, limits number of loops.
                 defaults to negative, which would run loops until there are no events to raise and
                 no task to run. 

        '''

        if setproctitle is not None:
            run_id = "%s." % self.run_id if self.run_id else ''
            setproctitle("eventor: %s" % (run_id,))

        if max_loops < 0:
            result=self.loop_session()
        else:
            result=None
            for _ in range(max_loops):
                #module_logger.debug('Starting loop cycle')
                result=self.loop_cycle()
            human_result="success" if result else 'failure'
            total_todo, _=self.count_todos(with_delayeds=True) 
            module_logger.info('Processing finished with: %s; outstanding tasks: %s' % (human_result, total_todo))
            #module_logger.info('Processing finished')

        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号