Sha256: 0f58ccbf51dc71ec4ad99933b81b1c2fbd16b7e71bc769bbdf281b28e3d9733e

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

class RedisLock
  class Strategy
    attr_reader :lock, :args

    def initialize(lock, args = {})
      @lock = lock
      @args = args
    end

    def call(&block)
      raise NotImplementedError
    end

    def after_perform
    end

    private

    def _perform(&block)
      yield lock
    rescue => e
      lock.config.logger.error "[#{self.class}] key: `#{lock.key}` error:"
      lock.config.logger.error e
      raise e
    ensure
      after_perform
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redis_lock-0.4.4 lib/redis_lock/strategy.rb
redis_lock-0.4.3 lib/redis_lock/strategy.rb