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.



511
512
513
514
# File 'lib/sidekiq/api.rb', line 511

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



509
510
511
# File 'lib/sidekiq/api.rb', line 509

def name
  @name
end

Instance Method Details

#clearObject Also known as: 💣



520
521
522
523
524
# File 'lib/sidekiq/api.rb', line 520

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

#sizeObject



516
517
518
# File 'lib/sidekiq/api.rb', line 516

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