Sha256: 682316a74b15772775aa689bf3d09231fb1452d2a5e5e9177d7a1b702767563e

Contents?: true

Size: 353 Bytes

Versions: 7

Compression:

Stored size: 353 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

  def delete_instance(name)
    @instances.delete [name]
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sidekiq-limit_fetch-4.4.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.3.2 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.3.1 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.3.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.2.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.1.0 lib/sidekiq/limit_fetch/instances.rb
sidekiq-limit_fetch-4.0.0 lib/sidekiq/limit_fetch/instances.rb