wb_background_thread.py 文件源码

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

项目:scm-workbench 作者: barry-scott 项目源码 文件源码
def __call__( self, *args, **kwds ):
        self.debugLogThreading( 'ThreadSwitchScheduler(%d:%s): start %r( %r, %r )' % (self.instance_id, self.reason, self.function, args, kwds) )

        #pylint disable=bare-except
        try:
            # call the function
            result = self.function( *args, **kwds )

            # did the function run or make a generator?
            if type(result) != types.GeneratorType:
                self.debugLogThreading( 'ThreadSwitchScheduler(%d:%s): done (not GeneratorType)' % (self.instance_id, self.reason) )
                # it ran - we are all done
                return

            # step the generator
            self.queueNextSwitch( result )

        except:
            self.app.log.exception( 'ThreadSwitchScheduler(%d:%s)' % (self.instance_id, self.reason) )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号