Module: Dataset
- Defined in:
- app/dataset.rb
Constant Summary collapse
- LOCK =
Mutex.new
Class Method Summary collapse
Class Method Details
.<<(url) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/dataset.rb', line 25 def self.<<(url) if not $started $started = true start end LOCK.lock $dataset << url $dataset.uniq! LOCK.unlock end |
.rm(url) ⇒ Object
36 37 38 39 40 |
# File 'app/dataset.rb', line 36 def self.rm(url) LOCK.lock $dataset.remove url LOCK.unlock end |
.start ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/dataset.rb', line 8 def self.start Thread.new do loop do $dataset.each do |url| print "Open #{url} " begin open(url) puts "SUCCESS" rescue => err puts "FAILURE #{err.}" end sleep 1 end end end end |