Method: Concurrent::Semaphore#try_acquire
- Defined in:
- lib/concurrent-ruby/concurrent/atomic/semaphore.rb
#try_acquire(permits = 1, timeout = nil) ⇒ true, ...
Acquires the given number of permits from this semaphore,
only if all are available at the time of invocation or within
`timeout` interval. If a block is given, yields to it if the permits
were successfully acquired, and releases them afterward, returning the
block's return value.
161 162 |
# File 'lib/concurrent-ruby/concurrent/atomic/semaphore.rb', line 161 class Semaphore < SemaphoreImplementation end |