def wait(self): """ Wait for all running containers to stop. """ try: SpawningProxy(self.containers, abort_on_error=True).wait() except Exception: # If a single container failed, stop its peers and re-raise the # exception self.stop() raise
def kill(self): """ Kill all running containers concurrently. The method will block until all containers have stopped. """ service_names = ', '.join(self.service_names) _log.info('killing services: %s', service_names) SpawningProxy(self.containers).kill() _log.debug('services killed: %s ', service_names)
def stop(self): """ Stop all running containers concurrently. The method blocks until all containers have stopped. """ service_names = ', '.join(self.service_names) _log.info('stopping services: %s', service_names) SpawningProxy(self.containers).stop() _log.debug('services stopped: %s', service_names)
def start(self): """ Start all the registered services. A new container is created for each service using the container class provided in the __init__ method. All containers are started concurrently and the method will block until all have completed their startup routine. """ service_names = ', '.join(self.service_names) _log.info('starting services: %s', service_names) SpawningProxy(self.containers).start() _log.debug('services started: %s', service_names)
def start(self): """ Start all the registered services. A new container is created for each service using the container class provided in the __init__ method. All containers are started concurrently and the method will block until all have completed their startup routine. 启动所有注册的服务。 使用__init__方法中提供的容器类为每个服务创建一个新容器。 所有容器同时启动,该方法将阻塞,直到所有容器都完成了它们的启动例程。 """ service_names = ', '.join(self.service_names) _log.info('starting services: %s', service_names) SpawningProxy(self.containers).start() _log.debug('services started: %s', service_names)