Class: SidekiqUniqueJobs::OnConflict::Strategy Abstract
- Inherits:
-
Object
- Object
- SidekiqUniqueJobs::OnConflict::Strategy
- Includes:
- JSON, Logging, Script::Caller, Timing
- Defined in:
- lib/sidekiq_unique_jobs/on_conflict/strategy.rb
Overview
This class is abstract.
Abstract conflict strategy class
Direct Known Subclasses
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#redis_pool ⇒ Object
readonly
Returns the value of attribute redis_pool.
Instance Method Summary collapse
-
#call ⇒ Object
Use strategy on conflict.
-
#initialize(item, redis_pool = nil) ⇒ Strategy
constructor
Initialize a new Strategy.
-
#replace? ⇒ true, false
Check if the strategy is kind of Replace.
Methods included from Timing
clock_stamp, now_f, time_source, timed
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
Methods included from JSON
dump_json, load_json, safe_load_json
Constructor Details
#initialize(item, redis_pool = nil) ⇒ Strategy
Initialize a new Strategy
28 29 30 31 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 28 def initialize(item, redis_pool = nil) @item = item @redis_pool = redis_pool end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
17 18 19 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 17 def item @item end |
#redis_pool ⇒ Object (readonly)
Returns the value of attribute redis_pool.
20 21 22 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 20 def redis_pool @redis_pool end |
Instance Method Details
#call ⇒ Object
Use strategy on conflict
35 36 37 |
# File 'lib/sidekiq_unique_jobs/on_conflict/strategy.rb', line 35 def call raise NotImplementedError, "needs to be implemented in child class" end |