Sha256: 7ef3510be31f4000ec0fcdc199bb637c15e61d42e4b959d953cd936b42d4db4d
Contents?: true
Size: 827 Bytes
Versions: 2
Compression:
Stored size: 827 Bytes
Contents
# frozen_string_literal: true require_relative 'config' require_relative 'logging' require_relative 'preamble' require_relative 'globals' require_relative 'task' class Application include AppPreamble def logger G.logger end def initialize setup! G.config = @config.freeze G.logger = DualLogger::new self end private def tasks! @tasks = Queue::new @files.each do |file| @tasks.push Task::new(self, file) end end private def start! @threads = [] count = [ @tasks.size, G.config[:threads][:tasks] ].min count.times do @threads << Thread.start do while !@tasks.empty? task = @tasks.pop task.execute end end end @threads.each { |th| th.join } end def run preamble! tasks! start! end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
inat-get-0.8.0.12 | lib/inat/app/application.rb |
inat-get-0.8.0.11 | lib/inat/app/application.rb |