def job_enumerator
      return Enumerator.new do |yielder|
        max_id = max_job_id

        initial_cached_jobs = cached_jobs.values_at(*cached_jobs.keys.sort.reverse)

        max_id.downto(self.max_climbed_job_id + 1) do |job_id|
          job = fetch_and_cache_job(job_id)
          yielder << job unless job.nil?
        end

        initial_cached_jobs.each do |job|
          if job.exists?
            yielder << job
          else
            self.cached_jobs.delete(job.id)
          end
        end

        ([self.min_climbed_job_id - 1, max_id].min).downto(1) do |job_id|
          job = fetch_and_cache_job(job_id)
          yielder << job unless job.nil?
        end
        nil
      end
    end
def job_enumerator
      return Enumerator.new do |yielder|
        max_id = max_job_id

        initial_cached_jobs = cached_jobs.values_at(*cached_jobs.keys.sort.reverse)

        max_id.downto(self.max_climbed_job_id + 1) do |job_id|
          job = fetch_and_cache_job(job_id)
          yielder << job unless job.nil?
        end

        initial_cached_jobs.each do |job|
          if job.exists?
            yielder << job
          else
            self.cached_jobs.delete(job.id)
          end
        end

        ([self.min_climbed_job_id - 1, max_id].min).downto(1) do |job_id|
          job = fetch_and_cache_job(job_id)
          yielder << job unless job.nil?
        end
        nil
      end
    end
Returns an Enumerator for crawling all existing jobs for a connection.
 See Connection#each_job for more information.