Sha256: 8561a04efbc3a53589b80ffc085df377d9d2b9be0329b18669ec01edf9b8beb7

Contents?: true

Size: 201 Bytes

Versions: 25

Compression:

Stored size: 201 Bytes

Contents

class Locking
  def self.lock_on(key, wait:, attempts:, &block)
    counter = Kredis.counter(key, expires_in: wait)
    counter.increment

    if counter.value > attempts
      yield
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
authentication-zero-2.7.0 lib/generators/authentication/templates/models/locking.rb.tt
authentication-zero-2.6.0 lib/generators/authentication/templates/models/locking.rb.tt
authentication-zero-2.5.1 lib/generators/authentication/templates/models/locking.rb.tt
authentication-zero-2.5.0 lib/generators/authentication/templates/models/locking.rb.tt
authentication-zero-2.4.0 lib/generators/authentication/templates/models/locking.rb.tt