class Sidekiq::SortedSet

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
# File lib/sidekiq/api.rb, line 558
def initialize(name)
  @name = name
  @_size = size
end

Public Instance Methods

clear() click to toggle source
# File lib/sidekiq/api.rb, line 578
def clear
  Sidekiq.redis do |conn|
    conn.unlink(name)
  end
end
Also aliased as: 💣
scan(match, count = 100) { |sorted_entry| ... } click to toggle source
# File lib/sidekiq/api.rb, line 567
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
size() click to toggle source
# File lib/sidekiq/api.rb, line 563
def size
  Sidekiq.redis { |c| c.zcard(name) }
end
💣()
Alias for: clear