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


Python amqp.get_connection_pool函数代码示例

本文整理汇总了Python中savanna.openstack.common.rpc.amqp.get_connection_pool函数的典型用法代码示例。如果您正苦于以下问题:Python get_connection_pool函数的具体用法?Python get_connection_pool怎么用?Python get_connection_pool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: join_consumer_pool

    def join_consumer_pool(self, callback, pool_name, topic,
                           exchange_name=None, ack_on_error=True):
        """Register as a member of a group of consumers for a given topic from
        the specified exchange.

        Exactly one member of a given pool will receive each message.

        A message will be delivered to multiple pools, if more than
        one is created.
        """
        callback_wrapper = rpc_amqp.CallbackWrapper(
            conf=self.conf,
            callback=callback,
            connection_pool=rpc_amqp.get_connection_pool(self.conf,
                                                         Connection),
            wait_for_consumers=not ack_on_error
        )
        self.proxy_callbacks.append(callback_wrapper)

        consumer = TopicConsumer(conf=self.conf,
                                 session=self.session,
                                 topic=topic,
                                 callback=callback_wrapper,
                                 name=pool_name,
                                 exchange_name=exchange_name)

        self._register_consumer(consumer)
        return consumer
开发者ID:StokesB1,项目名称:savanna,代码行数:28,代码来源:impl_qpid.py

示例2: create_worker

 def create_worker(self, topic, proxy, pool_name):
     """Create a worker that calls a method in a proxy object."""
     proxy_cb = rpc_amqp.ProxyCallback(
         self.conf, proxy,
         rpc_amqp.get_connection_pool(self.conf, Connection))
     self.proxy_callbacks.append(proxy_cb)
     self.declare_topic_consumer(topic, proxy_cb, pool_name)
开发者ID:simedcn,项目名称:savanna,代码行数:7,代码来源:impl_kombu.py

示例3: create_consumer

    def create_consumer(self, topic, proxy, fanout=False):
        """Create a consumer that calls a method in a proxy object."""
        proxy_cb = rpc_amqp.ProxyCallback(self.conf, proxy, rpc_amqp.get_connection_pool(self.conf, Connection))
        self.proxy_callbacks.append(proxy_cb)

        if fanout:
            self.declare_fanout_consumer(topic, proxy_cb)
        else:
            self.declare_topic_consumer(topic, proxy_cb)
开发者ID:jfzhang2013,项目名称:savanna,代码行数:9,代码来源:impl_kombu.py

示例4: create_worker

    def create_worker(self, topic, proxy, pool_name):
        """Create a worker that calls a method in a proxy object."""
        proxy_cb = rpc_amqp.ProxyCallback(
            self.conf, proxy,
            rpc_amqp.get_connection_pool(self.conf, Connection))
        self.proxy_callbacks.append(proxy_cb)

        consumer = TopicConsumer(self.conf, self.session, topic, proxy_cb,
                                 name=pool_name)

        self._register_consumer(consumer)

        return consumer
开发者ID:StokesB1,项目名称:savanna,代码行数:13,代码来源:impl_qpid.py

示例5: create_consumer

    def create_consumer(self, topic, proxy, fanout=False):
        """Create a consumer that calls a method in a proxy object."""
        proxy_cb = rpc_amqp.ProxyCallback(
            self.conf, proxy,
            rpc_amqp.get_connection_pool(self.conf, Connection))
        self.proxy_callbacks.append(proxy_cb)

        if fanout:
            consumer = FanoutConsumer(self.conf, self.session, topic, proxy_cb)
        else:
            consumer = TopicConsumer(self.conf, self.session, topic, proxy_cb)

        self._register_consumer(consumer)

        return consumer
开发者ID:StokesB1,项目名称:savanna,代码行数:15,代码来源:impl_qpid.py

示例6: notify

def notify(conf, context, topic, msg, envelope):
    """Sends a notification event on a topic."""
    return rpc_amqp.notify(conf, context, topic, msg, rpc_amqp.get_connection_pool(conf, Connection), envelope)
开发者ID:jfzhang2013,项目名称:savanna,代码行数:3,代码来源:impl_kombu.py

示例7: fanout_cast_to_server

def fanout_cast_to_server(conf, context, server_params, topic, msg):
    """Sends a message on a fanout exchange to a specific server."""
    return rpc_amqp.fanout_cast_to_server(
        conf, context, server_params, topic, msg, rpc_amqp.get_connection_pool(conf, Connection)
    )
开发者ID:jfzhang2013,项目名称:savanna,代码行数:5,代码来源:impl_kombu.py

示例8: fanout_cast

def fanout_cast(conf, context, topic, msg):
    """Sends a message on a fanout exchange without waiting for a response."""
    return rpc_amqp.fanout_cast(conf, context, topic, msg, rpc_amqp.get_connection_pool(conf, Connection))
开发者ID:jfzhang2013,项目名称:savanna,代码行数:3,代码来源:impl_kombu.py

示例9: call

def call(conf, context, topic, msg, timeout=None):
    """Sends a message on a topic and wait for a response."""
    return rpc_amqp.call(conf, context, topic, msg, timeout, rpc_amqp.get_connection_pool(conf, Connection))
开发者ID:jfzhang2013,项目名称:savanna,代码行数:3,代码来源:impl_kombu.py

示例10: multicall

def multicall(conf, context, topic, msg, timeout=None):
    """Make a call that returns multiple times."""
    return rpc_amqp.multicall(conf, context, topic, msg, timeout, rpc_amqp.get_connection_pool(conf, Connection))
开发者ID:jfzhang2013,项目名称:savanna,代码行数:3,代码来源:impl_kombu.py

示例11: create_connection

def create_connection(conf, new=True):
    """Create a connection."""
    return rpc_amqp.create_connection(conf, new, rpc_amqp.get_connection_pool(conf, Connection))
开发者ID:jfzhang2013,项目名称:savanna,代码行数:3,代码来源:impl_kombu.py


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