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.



448
449
450
451
# File 'lib/sidekiq/api.rb', line 448

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



446
447
448
# File 'lib/sidekiq/api.rb', line 446

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣



457
458
459
460
461
# File 'lib/sidekiq/api.rb', line 457

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

#sizeObject



453
454
455
# File 'lib/sidekiq/api.rb', line 453

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