def with_timeout(do_loop=true)
      Timeout.timeout(10) do
        dead_working = @working.values.reject(&:alive?)
        if dead_working.size > 0
          dead_working.map(&:join)
        end

        yield
      end
    rescue TimeoutError
      retry if do_loop
    end
def with_timeout(do_loop=true)
      Timeout.timeout(10) do
        dead_working = @working.values.reject(&:alive?)
        if dead_working.size > 0
          dead_working.map(&:join)
        end

        yield
      end
    rescue TimeoutError
      retry if do_loop
    end
Helper method for scheduling. Wraps items in a timeout and immediately
 checks all running workers for exceptions, which are immediately bubbled up
 if there are any. If do_loop is true, it will retry the timeout.