• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.get_messaging_urls函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_listener

def get_listener():
    global _listener
    if not _listener:
        with Connection(transport_utils.get_messaging_urls()) as conn:
            _listener = Listener(conn)
            eventlet.spawn_n(listen, _listener)
    return _listener
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:7,代码来源:listener.py


示例2: start

 def start(self):
     try:
         self.connection = Connection(transport_utils.get_messaging_urls())
         self._updates_thread = eventlet.spawn(self.run)
     except:
         LOG.exception('Failed to start sensor_watcher.')
         self.connection.release()
开发者ID:Bala96,项目名称:st2,代码行数:7,代码来源:sensor_watcher.py


示例3: main

def main(queue, exchange, routing_key='#'):
    exchange = Exchange(exchange, type='topic')
    queue = Queue(name=queue, exchange=exchange, routing_key=routing_key,
                  auto_delete=True)

    with Connection(transport_utils.get_messaging_urls()) as connection:
        watcher = QueueConsumer(connection=connection, queue=queue)
        watcher.run()
开发者ID:lyandut,项目名称:st2,代码行数:8,代码来源:queue_consumer.py


示例4: test_process_message

 def test_process_message(self):
     with Connection(transport_utils.get_messaging_urls()) as conn:
         tracker = ResultsTracker(conn, [ACTIONSTATE_WORK_Q])
         tracker._bootstrap()
         state = ActionStateConsumerTests.get_state(
             ActionStateConsumerTests.liveactions['liveaction1.yaml'])
         tracker._queue_consumer._process_message(state)
         querier = tracker.get_querier('tests.resources.test_querymodule')
         self.assertEqual(querier._query_contexts.qsize(), 1)
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:9,代码来源:test_action_state_consumer.py


示例5: get_listener

def get_listener(name):
    global _stream_listener
    global _execution_output_listener

    if name == 'stream':
        if not _stream_listener:
            with Connection(transport_utils.get_messaging_urls()) as conn:
                _stream_listener = StreamListener(conn)
                eventlet.spawn_n(listen, _stream_listener)
        return _stream_listener
    elif name == 'execution_output':
        if not _execution_output_listener:
            with Connection(transport_utils.get_messaging_urls()) as conn:
                _execution_output_listener = ExecutionOutputListener(conn)
                eventlet.spawn_n(listen, _execution_output_listener)
        return _execution_output_listener
    else:
        raise ValueError('Invalid listener name: %s' % (name))
开发者ID:lyandut,项目名称:st2,代码行数:18,代码来源:listener.py


示例6: _cleanup_old_queues

 def _cleanup_old_queues(self):
     with Connection(transport_utils.get_messaging_urls()) as connection:
         for q in self.OLD_QS:
             bound_q = q(connection.default_channel)
             try:
                 bound_q.delete()
             except:
                 print('Failed to delete %s.' % q.name)
                 traceback.print_exc()
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:9,代码来源:migrate_messaging_setup.py


示例7: __init__

 def __init__(self, urls=None):
     """
     :param urls: Connection URLs to use. If not provided it uses a default value from th
                  config.
     :type urls: ``list``
     """
     urls = urls or transport_utils.get_messaging_urls()
     connection = transport_utils.get_connection(urls=urls,
                                                 connection_kwargs={'failover_strategy':
                                                                    'round-robin'})
     self.pool = connection.Pool(limit=10)
     self.cluster_size = len(urls)
开发者ID:nzlosh,项目名称:st2,代码行数:12,代码来源:publishers.py


示例8: register_exchanges

def register_exchanges():
    LOG.debug('Registering exchanges...')
    connection_urls = transport_utils.get_messaging_urls()
    with Connection(connection_urls) as conn:
        # Use ConnectionRetryWrapper to deal with rmq clustering etc.
        retry_wrapper = ConnectionRetryWrapper(cluster_size=len(connection_urls), logger=LOG)

        def wrapped_register_exchanges(connection, channel):
            for exchange in EXCHANGES:
                _do_register_exchange(exchange=exchange, connection=connection, channel=channel,
                                      retry_wrapper=retry_wrapper)

        retry_wrapper.run(connection=conn, wrapped_callback=wrapped_register_exchanges)
开发者ID:LindsayHill,项目名称:st2,代码行数:13,代码来源:bootstrap_utils.py


示例9: __init__

 def __init__(self, logger=LOG):
     self._publisher = AnnouncementPublisher(urls=transport_utils.get_messaging_urls())
     self._logger = logger
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:announcement.py


示例10: _get_publisher

 def _get_publisher(cls):
     if not cls.publisher:
         cls.publisher = FakeModelPublisher(transport_utils.get_messaging_urls())
     return cls.publisher
开发者ID:lyandut,项目名称:st2,代码行数:4,代码来源:test_state_publisher.py


示例11: get_tracker

def get_tracker():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return ResultsTracker(conn, [ACTIONSTATE_WORK_Q])
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:resultstracker.py


示例12: get_notifier

def get_notifier():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return Notifier(conn, [ACTIONUPDATE_WORK_Q], trigger_dispatcher=TriggerDispatcher(LOG))
开发者ID:LindsayHill,项目名称:st2,代码行数:3,代码来源:notifier.py


示例13: __init__

 def __init__(self, logger=LOG):
     self._publisher = TriggerInstancePublisher(urls=transport_utils.get_messaging_urls())
     self._logger = logger
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:reactor.py


示例14: get_worker

def get_worker():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return ActionExecutionDispatcher(conn, ACTIONRUNNER_QUEUES)
开发者ID:lyandut,项目名称:st2,代码行数:3,代码来源:worker.py


示例15: get_engine

def get_engine():
    with kombu.Connection(txpt_utils.get_messaging_urls()) as conn:
        return WorkflowExecutionHandler(conn, WORKFLOW_EXECUTION_QUEUES)
开发者ID:StackStorm,项目名称:st2,代码行数:3,代码来源:workflows.py


示例16: get_handler

def get_handler():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return FakeMessageHandler(conn, [FAKE_WORK_Q])
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:test_queue_consumer.py


示例17: _get_publisher

 def _get_publisher(cls):
     if not cls.publisher:
         cls.publisher = transport.reactor.TriggerCUDPublisher(
             urls=transport_utils.get_messaging_urls())
     return cls.publisher
开发者ID:joshgre,项目名称:st2,代码行数:5,代码来源:trigger.py


示例18: get_tracker

def get_tracker():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return ResultsTracker(conn, [RESULTSTRACKER_ACTIONSTATE_WORK_QUEUE])
开发者ID:lyandut,项目名称:st2,代码行数:3,代码来源:resultstracker.py


示例19: _get_publisher

 def _get_publisher(cls):
     if not cls.publisher:
         cls.publisher = transport.actionexecutionstate.ActionExecutionStatePublisher(
             urls=transport_utils.get_messaging_urls())
     return cls.publisher
开发者ID:lyandut,项目名称:st2,代码行数:5,代码来源:executionstate.py


示例20: get_scheduler

def get_scheduler():
    with Connection(transport_utils.get_messaging_urls()) as conn:
        return ActionExecutionScheduler(conn, [ACTIONRUNNER_REQUEST_Q])
开发者ID:AlexeyDeyneko,项目名称:st2,代码行数:3,代码来源:scheduler.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python action_db.get_liveaction_by_id函数代码示例发布时间:2022-05-27
下一篇:
Python reactor.TriggerDispatcher类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap