本文整理匯總了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)
示例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
示例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)
示例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")
示例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)