Class: SidekiqUniqueJobs::Redis::List

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

Overview

Class List provides convenient access to redis hashes

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

The number of entries in this list

Returns:

  • (Integer)

    the total number of entries



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

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

#entriesArray<Object>

Entries in this list

Returns:

  • (Array<Object>)

    the elements in this list



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

def entries
  redis { |conn| conn.lrange(key, 0, -1) }
end