class Sidekiq::SortedSet

Base class for all sorted sets within Sidekiq.

def as_json(options = nil)

Other tags:
    Api: - private
def as_json(options = nil)
  {name: name} # 5336
end

def clear

Returns:
  • (Boolean) - always true
def clear
  Sidekiq.redis do |conn|
    conn.unlink(name)
  end
  true
end

def initialize(name)

Other tags:
    Api: - private
def initialize(name)
  @name = name
  @_size = size
end

def scan(match, count = 100)

Other tags:
    Yieldparam: each - entry

Parameters:
  • count (Integer) -- number of elements to retrieve at a time, default 100
  • match (String) -- a snippet or regexp to filter matches.
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(name, match: match, count: count) do |entry, score|
      yield SortedEntry.new(self, score, entry)
    end
  end
end

def size

real-time size of the set, will change
def size
  Sidekiq.redis { |c| c.zcard(name) }
end