class Sidekiq::SortedSet

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