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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣



465
466
467
468
469
# File 'lib/sidekiq/api.rb', line 465

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

#sizeObject



461
462
463
# File 'lib/sidekiq/api.rb', line 461

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