本文整理汇总了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)