本文整理汇总了Python中circus.arbiter.Arbiter.start_watcher方法的典型用法代码示例。如果您正苦于以下问题:Python Arbiter.start_watcher方法的具体用法?Python Arbiter.start_watcher怎么用?Python Arbiter.start_watcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类circus.arbiter.Arbiter
的用法示例。
在下文中一共展示了Arbiter.start_watcher方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_start_watchers_warmup_delay
# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import start_watcher [as 别名]
def test_start_watchers_warmup_delay(self):
watcher = MockWatcher(name='foo', cmd='serve', priority=1)
arbiter = Arbiter([], None, None, warmup_delay=10)
with patch('circus.arbiter.sleep') as mock_sleep:
arbiter.start_watcher(watcher)
mock_sleep.assert_called_with(10)
# now make sure we don't sleep when there is a autostart
watcher = MockWatcher(name='foo', cmd='serve', priority=1,
autostart=False)
with patch('circus.arbiter.sleep') as mock_sleep:
arbiter.start_watcher(watcher)
assert not mock_sleep.called
示例2: test_start_watcher
# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import start_watcher [as 别名]
def test_start_watcher(self):
watcher = MockWatcher(name='foo', cmd='serve', priority=1)
arbiter = Arbiter([], None, None)
arbiter.start_watcher(watcher)
self.assertTrue(watcher.started)
示例3: test_start_watchers_with_autostart
# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import start_watcher [as 别名]
def test_start_watchers_with_autostart(self):
watcher = MockWatcher(name='foo', cmd='serve', priority=1,
autostart=False)
arbiter = Arbiter([], None, None)
arbiter.start_watcher(watcher)
self.assertFalse(getattr(watcher, 'started', False))
示例4: test_start_watcher
# 需要导入模块: from circus.arbiter import Arbiter [as 别名]
# 或者: from circus.arbiter.Arbiter import start_watcher [as 别名]
def test_start_watcher(self):
watcher = MockWatcher(name='foo', cmd='serve', priority=1)
arbiter = Arbiter([], None, None, check_delay=-1)
yield arbiter.start_watcher(watcher)
self.assertTrue(watcher.is_active())