當前位置: 首頁>>代碼示例>>Python>>正文


Python oslo_messaging.get_transport方法代碼示例

本文整理匯總了Python中oslo_messaging.get_transport方法的典型用法代碼示例。如果您正苦於以下問題:Python oslo_messaging.get_transport方法的具體用法?Python oslo_messaging.get_transport怎麽用?Python oslo_messaging.get_transport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oslo_messaging的用法示例。


在下文中一共展示了oslo_messaging.get_transport方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _get_transport

# 需要導入模塊: import oslo_messaging [as 別名]
# 或者: from oslo_messaging import get_transport [as 別名]
def _get_transport():
    return messaging.get_transport(cfg.CONF, CONF.messaging_transport_url,
                                   allowed_remote_exmods=ALLOWED_EXMODS) 
開發者ID:cloudbase,項目名稱:vdi-broker,代碼行數:5,代碼來源:rpc.py

示例2: __init__

# 需要導入模塊: import oslo_messaging [as 別名]
# 或者: from oslo_messaging import get_transport [as 別名]
def __init__(self, topic, host):
        try:
            transport = messaging.get_transport(cfg.CONF)
            target = messaging.Target(topic=topic, server=host)
            self.rpc_client = messaging.RPCClient(transport, target)
        except MessagingException as ex:
            raise ex 
開發者ID:WiproOpenSource,項目名稱:galaxia,代碼行數:9,代碼來源:client.py

示例3: __init__

# 需要導入模塊: import oslo_messaging [as 別名]
# 或者: from oslo_messaging import get_transport [as 別名]
def __init__(self, topic, host, handler):
        serializer = messaging.RequestContextSerializer(
                messaging.JsonPayloadSerializer())
        transport = messaging.get_transport(cfg.CONF)
        target = messaging.Target(topic=topic, server=host)
        self.rpc_server = messaging.get_rpc_server(transport, target, handler,
                                                   serializer=serializer) 
開發者ID:WiproOpenSource,項目名稱:galaxia,代碼行數:9,代碼來源:broker.py

示例4: test

# 需要導入模塊: import oslo_messaging [as 別名]
# 或者: from oslo_messaging import get_transport [as 別名]
def test(self, ctx, arg):
        return arg


# `Transport` is the capsulation of the Message Queue, such as RabbitMQ.
# If no @url, it will use `CONF.transport_url`.
# The specification of `url` is "transport://user:pass@host1:port[,userN:passN@hostN:portN]/virtual_host"
#transport = oslo_messaging.get_transport(cfg.CONF, url="rabbit://me:passwd@host:5672/virtual_host") 
開發者ID:xgfone,項目名稱:snippet,代碼行數:10,代碼來源:server.py

示例5: init

# 需要導入模塊: import oslo_messaging [as 別名]
# 或者: from oslo_messaging import get_transport [as 別名]
def init(conf, is_server_side=True):
    global TRANSPORT, IS_SERVER_SIDE
    exmods = get_allowed_exmods()
    IS_SERVER_SIDE = is_server_side
    TRANSPORT = messaging.get_transport(conf, allowed_remote_exmods=exmods) 
開發者ID:cloud-security-research,項目名稱:sgx-kms,代碼行數:7,代碼來源:__init__.py


注:本文中的oslo_messaging.get_transport方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。