def check_workers(self):
        '''Kill workers that have been pending for a while and check if all workers
        are alive. '''
        if time.time() - self._worker_alive_time > 5:
            self._worker_alive_time = time.time()
            # join processes if they are now gone, it should not do anything bad
            # if the process is still running
            [worker.join() for worker in self._workers if not worker.is_alive()]
            self._workers = [
                worker for worker in self._workers if worker.is_alive()
            ]
            if len(self._workers) < self._num_workers:
                raise ProcessKilled('One of the workers has been killed.')
Kill workers that have been pending for a while and check if all workers
        are alive.