Skip to content

Instantly share code, notes, and snippets.

@Mirai
Created April 13, 2012 20:04
Show Gist options
  • Save Mirai/2379753 to your computer and use it in GitHub Desktop.
Save Mirai/2379753 to your computer and use it in GitHub Desktop.
wq = WorkQueue.new(5)
i = 1
Dir.new(DIRECTORY).each do |file|
i2 = i
unless file.start_with?('.')
wq.enqueue_b do
move file to another directory
ImportFile.new(file, i2).run
end
end
i += 1
end
wq.join
===
class ImportFile
def initialize(file, number)
puts "In InputFile"
end
def run
puts "Processing file"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment