Method: Async::Semaphore#initialize

Defined in:
lib/async/semaphore.rb

#initialize(limit = 1, parent: nil) ⇒ Semaphore

Returns a new instance of Semaphore.



12
13
14
15
16
17
18
# File 'lib/async/semaphore.rb', line 12

def initialize(limit = 1, parent: nil)
  @count = 0
  @limit = limit
  @waiting = []
  
  @parent = parent
end