Sha256: 8341b25d44219f7f0ab03bb4055b0743f586246747b6594cc85bbc8135a02d77

Contents?: true

Size: 289 Bytes

Versions: 8

Compression:

Stored size: 289 Bytes

Contents

module Sidekiq::LimitFetch::Instances
  def self.extended(klass)
    klass.instance_variable_set :@instances, {}
  end

  def new(*args)
    @instances[args] ||= super
  end

  alias [] new

  def instances
    @instances.values
  end

  def reset_instances!
    @instances = {}
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rcgt-sidekiq-limit_fetch-3.4.1 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.4.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.3.1 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.3.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.2.1 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.1.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.0.1 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-3.0.0 lib/sidekiq/limit_fetch/instances.rb