Method: Async::Waiter#first

Defined in:
lib/async/waiter.rb

#first(count = nil) ⇒ Object

Wait for the first count tasks to complete.



41
42
43
44
45
46
47
48
49
# File 'lib/async/waiter.rb', line 41

def first(count = nil)
  minimum = count || 1
  
  while @done.size < minimum
    @finished.wait
  end
  
  return @done.shift(*count)
end