lib/checklinks/worklist.rb
# Process the jobs in the worklist in multiple concurrent background threads
Process the jobs in the worklist in multiple concurrent background threads
Process the jobs in the worklist in multiple concurrent background threads
def process_concurrently(n)
      raise if @threads
      @threads = n.times.map {
        Thread.new {
          until @queue.closed? && @queue.empty?
            job = @queue.pop
            next unless job
            @active.push :active
            yield job
            @active.pop
          end
        }
      }
    end
def process_concurrently ( n ) raise if @threads @threads = n . times . map { Thread . new { until @queue . closed? && @queue . empty? job = @queue . pop next unless job @active . push :active yield job @active . pop end } } end
Process the jobs in the worklist in multiple concurrent background threads
Process the jobs in the worklist in multiple concurrent background threads
n
<not_specific>