Module: Latch::Mixin
Instance Method Summary collapse
-
#latch(count = 1, timeout = nil, &block) ⇒ Object
Syntactic sugar!.
Instance Method Details
#latch(count = 1, timeout = nil, &block) ⇒ Object
Syntactic sugar!
7 8 9 10 11 |
# File 'lib/latch.rb', line 7 def latch(count = 1, timeout = nil, &block) l = Latch.new(count) block.call(l) l.await(timeout) end |