Class: Sidekiq::SortedSet
- Inherits:
-
Object
- Object
- Sidekiq::SortedSet
- Includes:
- Enumerable
- Defined in:
- lib/sidekiq/api.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#as_json(options = nil) ⇒ Object
:nodoc:.
- #clear ⇒ Object (also: #💣)
-
#initialize(name) ⇒ SortedSet
constructor
A new instance of SortedSet.
- #scan(match, count = 100) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize(name) ⇒ SortedSet
Returns a new instance of SortedSet.
569 570 571 572 |
# File 'lib/sidekiq/api.rb', line 569 def initialize(name) @name = name @_size = size end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
567 568 569 |
# File 'lib/sidekiq/api.rb', line 567 def name @name end |
Instance Method Details
#as_json(options = nil) ⇒ Object
:nodoc:
596 597 598 |
# File 'lib/sidekiq/api.rb', line 596 def as_json( = nil) # :nodoc: {name: name} # 5336 end |
#clear ⇒ Object Also known as: 💣
589 590 591 592 593 |
# File 'lib/sidekiq/api.rb', line 589 def clear Sidekiq.redis do |conn| conn.unlink(name) end end |
#scan(match, count = 100) ⇒ Object
578 579 580 581 582 583 584 585 586 587 |
# File 'lib/sidekiq/api.rb', line 578 def scan(match, count = 100) return to_enum(:scan, match, count) unless block_given? match = "*#{match}*" unless match.include?("*") Sidekiq.redis do |conn| conn.zscan_each(name, match: match, count: count) do |entry, score| yield SortedEntry.new(self, score, entry) end end end |