def reap_workers(waitpidflags = 0)
      loop do
        worker_pid, status = Process.waitpid2(-1, waitpidflags)
        if worker_pid.nil?
          return :none_ready
        else
          log "Worker exited #{status}"
          finish_worker(worker_pid, status)
          report_to_master("-#{worker_pid}")
        end
      end
    rescue Errno::ECHILD
      # All done
      :no_child
    end
def reap_workers(waitpidflags = 0)
      loop do
        worker_pid, status = Process.waitpid2(-1, waitpidflags)
        if worker_pid.nil?
          return :none_ready
        else
          log "Worker exited #{status}"
          finish_worker(worker_pid, status)
          report_to_master("-#{worker_pid}")
        end
      end
    rescue Errno::ECHILD
      # All done
      :no_child
    end
Private: Check for workers that have stopped running