__init__.py 文件源码

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

项目:pycos 作者: pgiri 项目源码 文件源码
def terminate(self):
        """Terminate task.

        If this method called by a thread (and not a task), there is a chance
        that task being terminated is currently running and can interfere with
        GenratorExit exception that will be thrown to task.

        Can also be used on remotely running tasks.
        """
        if self._location:
            request = _NetRequest('terminate_task', kwargs={'task': self._id, 'name': self._name},
                                  dst=self._location, timeout=MsgTimeout)
            if _Peer.send_req(request) != 0:
                logger.warning('remote task at %s may not be valid', self._location)
                return -1
            return 0
        else:
            return self._scheduler._terminate_task(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号