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.



495
496
497
498
# File 'lib/sidekiq/api.rb', line 495

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



493
494
495
# File 'lib/sidekiq/api.rb', line 493

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣



504
505
506
507
508
# File 'lib/sidekiq/api.rb', line 504

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

#sizeObject



500
501
502
# File 'lib/sidekiq/api.rb', line 500

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