Class: FastestServer::Fastest
- Inherits:
-
Object
- Object
- FastestServer::Fastest
- Defined in:
- lib/fastest_server/fastest.rb
Instance Method Summary collapse
- #give_me_answer ⇒ Object
-
#initialize(targets, max, verbose) ⇒ Fastest
constructor
A new instance of Fastest.
Constructor Details
#initialize(targets, max, verbose) ⇒ Fastest
Returns a new instance of Fastest.
3 4 5 6 7 8 9 10 |
# File 'lib/fastest_server/fastest.rb', line 3 def initialize(targets, max, verbose) @max = [max, targets.size].min @jobs = targets @verbose = verbose @checkbook = {} @workers = Array.new(@max) { |i| Worker.new(i, @jobs, @checkbook) } @watcher = Thread.new { watch } if @verbose end |