agent.py 文件源码

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

项目:iotronic 作者: openstack 项目源码 文件源码
def wamp_request(e, kwarg, session):
    id = threading.current_thread().ident
    shared_result[id] = {}
    shared_result[id]['result'] = None

    def success(d):
        shared_result[id]['result'] = d
        LOG.debug("DEVICE sent: %s", str(d))
        e.set()
        return shared_result[id]['result']

    def fail(failure):
        shared_result[id]['result'] = failure
        LOG.error("WAMP FAILURE: %s", str(failure))
        e.set()
        return shared_result[id]['result']

    LOG.debug("Calling %s...", kwarg['wamp_rpc_call'])
    d = session.wamp_session.call(wamp_session_caller,
                                  kwarg['wamp_rpc_call'], *kwarg['data'])
    d.addCallback(success)
    d.addErrback(fail)


# OSLO ENDPOINT
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号