Class Moneta::Semaphore
In: lib/moneta/synchronize.rb
Parent: SynchronizePrimitive

Distributed/shared store-wide semaphore

@example Use `Moneta::Semaphore`

    semaphore = Moneta::Semaphore.new(store, 'semaphore', 2)
    semaphore.synchronize do
      # Synchronized access
      # ...
    end

@api public

Methods

Public Class methods

@param [Moneta store] store The store we want to lock @param [Object] counter Key of the counter entry @param [Fixnum] max Maximum number of threads which are allowed to enter the critical section

Protected Instance methods

[Validate]