Class: Sidekiq::SortedSet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sidekiq/api.rb

Direct Known Subclasses

JobSet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SortedSet

Returns a new instance of SortedSet.


379
380
381
382
# File 'lib/sidekiq/api.rb', line 379

def initialize(name)
  @name = name
  @_size = size
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


377
378
379
# File 'lib/sidekiq/api.rb', line 377

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣


388
389
390
391
392
# File 'lib/sidekiq/api.rb', line 388

def clear
  Sidekiq.redis do |conn|
    conn.del(name)
  end
end

#sizeObject


384
385
386
# File 'lib/sidekiq/api.rb', line 384

def size
  Sidekiq.redis {|c| c.zcard(name) }
end