Ejemplo n.º 1
0
    def populate(self):
        """
		Populate the pool instance processes, (prepares the processes).
		"""
        for name in self.names:
            self.pool[name] = process.InstanceProcess(queue=self.queue,
                                                      environment_name=name)
            self._restarts[name] = 0
        return self
Ejemplo n.º 2
0
    def restart(self, name=None):
        """
		Restart single process, or all if no name is given.

		:param name: Name or none for all pools.
		"""
        if name:
            self.pool[name] = process.InstanceProcess(queue=self.queue,
                                                      environment_name=name)
            self._restarts[name] += 1
            self.pool[name].start()
        else:
            for name in self.pool.keys():
                self.restart(name)