First, send SIGTERM to all processes and then wait
until they all have finished.
"""
Terminates all workers.
"""
"""
Terminates all workers.
"""
+ # First send SIGTERM to all processes.
+ self.terminate_worker(self.keepalive)
for worker in self.workers:
self.terminate_worker(worker)
for worker in self.workers:
self.terminate_worker(worker)
- # Wait until the worker has finished.
- worker.join()
-
- # Terminate the keepalive process.
- self.terminate_worker(self.keepalive)
+ # Then wait until they all have finished.
+ for worker in self.workers:
+ worker.join()
def remove_worker(self, worker):
"""
def remove_worker(self, worker):
"""