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.


536
537
538
539
# File 'lib/sidekiq/api.rb', line 536

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name


534
535
536
# File 'lib/sidekiq/api.rb', line 534

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣


545
546
547
548
549
# File 'lib/sidekiq/api.rb', line 545

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

#sizeObject


541
542
543
# File 'lib/sidekiq/api.rb', line 541

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