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