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


Python Arbiter.stop方法代码示例

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


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

示例1: test_start_arbiter_with_autostart

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
 def test_start_arbiter_with_autostart(self):
     arbiter = Arbiter([], DEFAULT_ENDPOINT_DEALER, DEFAULT_ENDPOINT_SUB,
                       loop=get_ioloop(),
                       check_delay=-1)
     arbiter.add_watcher('foo', SLEEP % 5, autostart=False)
     try:
         yield arbiter.start()
         self.assertEqual(arbiter.watchers[0].status(), 'stopped')
     finally:
         yield arbiter.stop()
开发者ID:aubustou,项目名称:circus,代码行数:12,代码来源:test_arbiter.py

示例2: test_start_arbiter_with_autostart

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
 def test_start_arbiter_with_autostart(self):
     arbiter = Arbiter([], DEFAULT_ENDPOINT_DEALER, DEFAULT_ENDPOINT_SUB,
                       loop=tornado.ioloop.IOLoop.instance(),
                       check_delay=-1)
     arbiter.add_watcher('foo', 'sleep 5', autostart=False)
     try:
         yield arbiter.start()
         self.assertEqual(arbiter.watchers[0].status(), 'stopped')
     finally:
         yield arbiter.stop()
开发者ID:bbinet,项目名称:circus,代码行数:12,代码来源:test_arbiter.py

示例3: test_add_watcher

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
 def test_add_watcher(self):
     controller = "tcp://127.0.0.1:%d" % get_available_port()
     sub = "tcp://127.0.0.1:%d" % get_available_port()
     arbiter = Arbiter([], controller, sub, loop=get_ioloop(),
                       check_delay=-1)
     arbiter.add_watcher('foo', SLEEP % 5)
     try:
         yield arbiter.start()
         self.assertEqual(arbiter.watchers[0].status(), 'active')
     finally:
         yield arbiter.stop()
开发者ID:aubustou,项目名称:circus,代码行数:13,代码来源:test_arbiter.py

示例4: test_circushttpd

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
 def test_circushttpd(self):
     arbiter = Arbiter([], DEFAULT_ENDPOINT_DEALER, DEFAULT_ENDPOINT_SUB,
                       loop=tornado.ioloop.IOLoop.instance(),
                       check_delay=-1, httpd=True, debug=True)
     self.arbiters.append(arbiter)
     try:
         yield arbiter.start()
         poll_for_callable(self.assertDictEqual,
                           arbiter.statuses, {'circushttpd': 'active'})
     finally:
         yield arbiter.stop()
开发者ID:bbinet,项目名称:circus,代码行数:13,代码来源:test_arbiter.py

示例5: test_circushttpd

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
    def test_circushttpd(self):
        controller = "tcp://127.0.0.1:%d" % get_available_port()
        sub = "tcp://127.0.0.1:%d" % get_available_port()

        arbiter = Arbiter([], controller, sub, loop=get_ioloop(),
                          check_delay=-1, httpd=True, debug=True)
        self.arbiters.append(arbiter)
        try:
            yield arbiter.start()
            poll_for_callable(self.assertDictEqual,
                              arbiter.statuses, {'circushttpd': 'active'})
        finally:
            yield arbiter.stop()
开发者ID:aubustou,项目名称:circus,代码行数:15,代码来源:test_arbiter.py

示例6: test_start_with_callback_and_given_loop

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
    def test_start_with_callback_and_given_loop(self):
        controller = "tcp://127.0.0.1:%d" % get_available_port()
        sub = "tcp://127.0.0.1:%d" % get_available_port()
        arbiter = Arbiter([], controller, sub, check_delay=-1,
                          loop=get_ioloop())

        callback = mock.MagicMock()

        try:
            yield arbiter.start(cb=callback)
        finally:
            yield arbiter.stop()

        self.assertEqual(callback.call_count, 0)
开发者ID:aubustou,项目名称:circus,代码行数:16,代码来源:test_arbiter.py

示例7: int

# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import stop [as 别名]
                    limit = cfg_name[7:]
                    rlimits[limit] = int(cfg_value)

            watcher = Watcher(name, cmd, numprocesses=numprocesses,
                        warmup_delay=warmup_delay, working_dir=working_dir,
                        shell=shell, uid=uid, gid=gid, send_hup=send_hup,
                        times=times, within=within, retry_in=retry_in,
                        max_retry=max_retry, graceful_timeout=graceful_timeout,
                        rlimits=rlimits)

            watchers.append(watcher)

    # main circus options
    check = cfg.dget('circus', 'check_delay', 5, int)
    endpoint = cfg.dget('circus', 'endpoint', 'tcp://127.0.0.1:5555')
    pubsub_endpoint = cfg.dget('circus', 'pubsub_endpoint',
            'tcp://127.0.0.1:5556')

    arbiter = Arbiter(watchers, endpoint, pubsub_endpoint, check)
    try:
        arbiter.start()
    finally:
        arbiter.stop()
        if pidfile is not None:
            pidfile.unlink()

    sys.exit(0)

if __name__ == '__main__':
    main()
开发者ID:sakti,项目名称:circus,代码行数:32,代码来源:circusd.py


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