Class: SidekiqUniqueJobs::Redis::Set

Inherits:
Entity
  • Object
show all
Defined in:
lib/sidekiq_unique_jobs/redis/set.rb

Overview

Class Set provides convenient access to redis sets

Author:

Instance Attribute Summary

Attributes inherited from Entity

#key

Instance Method Summary collapse

Methods inherited from Entity

#exist?, #expires?, #initialize, #pttl, #ttl

Methods included from Timing

clock_stamp, now_f, time_source, timed

Methods included from JSON

dump_json, load_json, safe_load_json

Methods included from Script::Caller

call_script, debug_lua, do_call, extract_args, max_history, normalize_argv, now_f, redis_version

Methods included from Logging

#build_message, included, #log_debug, #log_error, #log_fatal, #log_info, #log_warn, #logger, #logging_context, #with_configured_loggers_context, #with_logging_context

Constructor Details

This class inherits a constructor from SidekiqUniqueJobs::Redis::Entity

Instance Method Details

#countInteger

Returns the count for this sorted set

Returns:

  • (Integer)

    the number of entries



27
28
29
# File 'lib/sidekiq_unique_jobs/redis/set.rb', line 27

def count
  redis { |conn| conn.scard(key) }
end

#entriesArray<String>

Return entries for this set

Returns:



17
18
19
# File 'lib/sidekiq_unique_jobs/redis/set.rb', line 17

def entries
  redis { |conn| conn.smembers(key) }
end