rocket.py 文件源码

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

项目:touch-pay-client 作者: HackPucBemobi 项目源码 文件源码
def stop(self):
        self.alive = False

        if __debug__:
            log.debug("Stopping threads.")

        self.stop_server = True

        # Prompt the threads to die
        self.shrink(len(self.threads))

        # Stop futures initially
        if has_futures and self.app_info.get('futures'):
            if __debug__:
                log.debug("Future executor is present.  Python will not "
                          "exit until all jobs have finished.")
            self.app_info['executor'].shutdown(wait=False)

        # Give them the gun
        # active_threads = [t for t in self.threads if t.isAlive()]
        # while active_threads:
        #     t = active_threads.pop()
        #     t.kill()

        # Wait until they pull the trigger
        for t in self.threads:
            if t.isAlive():
                t.join()

        # Clean up the mess
        self.bring_out_your_dead()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号