当前位置: 首页>>代码示例>>Python>>正文


Python oslo_messaging.get_rpc_server方法代码示例

本文整理汇总了Python中oslo_messaging.get_rpc_server方法的典型用法代码示例。如果您正苦于以下问题:Python oslo_messaging.get_rpc_server方法的具体用法?Python oslo_messaging.get_rpc_server怎么用?Python oslo_messaging.get_rpc_server使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oslo_messaging的用法示例。


在下文中一共展示了oslo_messaging.get_rpc_server方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def __init__(self, topic, server, endpoints, binary):
        super(Service, self).__init__()
        serializer = _init_serializer()
        transport = messaging.get_rpc_transport(CONF)
        access_policy = dispatcher.DefaultRPCAccessPolicy
        # TODO(asalkeld) add support for version='x.y'
        target = messaging.Target(topic=topic, server=server)
        self.endpoints = endpoints
        self._server = messaging.get_rpc_server(transport, target, endpoints,
                                                executor='eventlet',
                                                serializer=serializer,
                                                access_policy=access_policy)
        self.binary = binary
        profiler.setup(binary, CONF.host) 
开发者ID:openstack,项目名称:zun,代码行数:16,代码来源:rpc_service.py

示例2: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, executor='threading',
               access_policy=dispatcher.DefaultRPCAccessPolicy,
               serializer=None):
    if TRANSPORT is None:
        init()

    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor=executor,
                                    serializer=serializer,
                                    access_policy=access_policy) 
开发者ID:openstack,项目名称:octavia,代码行数:14,代码来源:rpc.py

示例3: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    if TRANSPORT is None:
        raise AssertionError("'TRANSPORT' must not be None")
    if serializer is None:
        serializer = DesignateObjectSerializer()
    serializer = RequestContextSerializer(serializer)
    access_policy = rpc_dispatcher.DefaultRPCAccessPolicy
    return messaging.get_rpc_server(
        TRANSPORT,
        target,
        endpoints,
        executor='eventlet',
        serializer=serializer,
        access_policy=access_policy
    ) 
开发者ID:openstack,项目名称:designate,代码行数:17,代码来源:rpc.py

示例4: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    serializer = RequestContextSerializer(serializer)
    return messaging.get_rpc_server(_get_transport(), target, endpoints,
                                    executor='eventlet',
                                    serializer=serializer) 
开发者ID:cloudbase,项目名称:vdi-broker,代码行数:7,代码来源:rpc.py

示例5: __init__

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [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

示例6: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    access_policy = dispatcher.DefaultRPCAccessPolicy
    if profiler:
        serializer = ProfilerRequestContextSerializer(serializer)
    else:
        serializer = RequestContextSerializer(serializer)

    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor='eventlet',
                                    serializer=serializer,
                                    access_policy=access_policy) 
开发者ID:openstack,项目名称:magnum,代码行数:16,代码来源:rpc.py

示例7: __init__

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def __init__(self, topic, server, handlers, binary):
        super(Service, self).__init__()
        serializer = _init_serializer()
        transport = messaging.get_rpc_transport(CONF)
        # TODO(asalkeld) add support for version='x.y'
        access_policy = dispatcher.DefaultRPCAccessPolicy
        target = messaging.Target(topic=topic, server=server)
        self._server = messaging.get_rpc_server(transport, target, handlers,
                                                executor='eventlet',
                                                serializer=serializer,
                                                access_policy=access_policy)
        self.binary = binary
        profiler.setup(binary, CONF.host) 
开发者ID:openstack,项目名称:magnum,代码行数:15,代码来源:rpc_service.py

示例8: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    access_policy = dispatcher.DefaultRPCAccessPolicy
    serializer = RequestContextSerializer(serializer)
    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor='eventlet',
                                    serializer=serializer,
                                    access_policy=access_policy) 
开发者ID:openstack,项目名称:manila,代码行数:12,代码来源:rpc.py

示例9: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor='eventlet',
                                    serializer=serializer) 
开发者ID:cloud-security-research,项目名称:sgx-kms,代码行数:8,代码来源:__init__.py

示例10: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, transport, serializer=None):
    assert transport is not None

    if profiler:
        LOG.debug('profiler enabled for RPC server')
        serializer = ProfilerContextSerializer(serializer=serializer)

    access_policy = dispatcher.DefaultRPCAccessPolicy
    return messaging.get_rpc_server(transport,
                                    target,
                                    endpoints,
                                    serializer=serializer,
                                    access_policy=access_policy) 
开发者ID:openstack,项目名称:vitrage,代码行数:15,代码来源:rpc.py

示例11: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target=None, endpoints=None):
    access_policy = dispatcher.DefaultRPCAccessPolicy
    transport = get_transport()
    if not target:
        target = get_target()
    return oslo_messaging.get_rpc_server(transport, target,
                                         endpoints, executor='threading',
                                         access_policy=access_policy) 
开发者ID:openstack,项目名称:cloudkitty,代码行数:10,代码来源:messaging.py

示例12: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    assert TRANSPORT is not None
    serializer = RequestContextSerializer(serializer)
    access_policy = dispatcher.DefaultRPCAccessPolicy
    return oslo_messaging.get_rpc_server(TRANSPORT, target, endpoints,
                                         'eventlet', serializer,
                                         access_policy=access_policy) 
开发者ID:openstack,项目名称:tacker,代码行数:9,代码来源:rpc.py

示例13: build_topic_handler

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def build_topic_handler(self, topic_name, endpoints=()):
        access_policy = dispatcher.DefaultRPCAccessPolicy
        serializer = rpc.RequestContextSerializer(rpc.JsonPayloadSerializer())
        target = om.Target(
            topic=topic_name,
            # For compatibility, we can override it with 'host' opt
            server=CONF.host or socket.gethostname(),
            version=self.api_version,
        )
        return om.get_rpc_server(
            self.transport, target, endpoints,
            executor='eventlet', serializer=serializer,
            access_policy=access_policy) 
开发者ID:openstack,项目名称:watcher,代码行数:15,代码来源:service.py

示例14: get_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_server(target, endpoints, serializer=None):
    access_policy = dispatcher.DefaultRPCAccessPolicy
    return messaging.get_rpc_server(TRANSPORT,
                                    target,
                                    endpoints,
                                    executor='eventlet',
                                    serializer=serializer,
                                    access_policy=access_policy) 
开发者ID:openstack,项目名称:barbican,代码行数:10,代码来源:__init__.py

示例15: get_rpc_server

# 需要导入模块: import oslo_messaging [as 别名]
# 或者: from oslo_messaging import get_rpc_server [as 别名]
def get_rpc_server(target, endpoint, serializer=None):
    """Return a configured oslo_messaging rpc server."""
    if serializer is None:
        serializer = JsonPayloadSerializer()
    serializer = RequestContextSerializer(serializer)
    return messaging.get_rpc_server(TRANSPORT, target, [endpoint],
                                    executor='eventlet',
                                    serializer=serializer) 
开发者ID:openstack,项目名称:senlin,代码行数:10,代码来源:messaging.py


注:本文中的oslo_messaging.get_rpc_server方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。