Sha256: ac54ff978639afc5861b09a63bcb863205b303240e9635b2dd8d6c9c9ed3853c
Contents?: true
Size: 518 Bytes
Versions: 15
Compression:
Stored size: 518 Bytes
Contents
require 'open-uri' require 'thread' module Mixpanel class Subprocess Q = Queue.new ENDMARKER = Object.new Thread.abort_on_exception = true producer = Thread.new do STDIN.each_line() do |url| STDERR.puts("Dropped: #{url}") && next if Q.length > 10000 Q << url end Q << ENDMARKER end loop do url = Q.pop break if(url == ENDMARKER) url.chomp! next if(url.empty?) #for testing open(url).read end producer.join end end
Version data entries
15 entries across 15 versions & 1 rubygems