netpycos.py 文件源码

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

项目:pycos 作者: pgiri 项目源码 文件源码
def __call__(self, *args, **kwargs):
        """Must be used with 'yeild' as 'rtask = yield rti(*args, **kwargs)'.

        Run RTI (method at remote location) with args and kwargs. Both args and
        kwargs must be serializable. Result is (remote) Task instance if call
        succeeds, otherwise it is None.
        """
        req = _NetRequest('run_rti', kwargs={'name': self._name, 'args': args, 'kwargs': kwargs,
                                             'mid': self._mid},
                          dst=self._location, timeout=MsgTimeout)
        reply = yield _Peer._sync_reply(req)
        if isinstance(reply, Task):
            raise StopIteration(reply)
        elif reply is None:
            raise StopIteration(None)
        else:
            raise Exception(reply)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号