Module: ActiveJob::Uniqueness::Strategies

Extended by:
ActiveSupport::Autoload
Defined in:
lib/active_job/uniqueness/strategies.rb,
lib/active_job/uniqueness/strategies/base.rb,
lib/active_job/uniqueness/strategies/until_expired.rb,
lib/active_job/uniqueness/strategies/until_executed.rb,
lib/active_job/uniqueness/strategies/until_executing.rb,
lib/active_job/uniqueness/strategies/while_executing.rb,
lib/active_job/uniqueness/strategies/until_and_while_executing.rb

Overview

See Configuration#lock_strategies if you want to define custom strategy

Defined Under Namespace

Classes: Base, UntilAndWhileExecuting, UntilExecuted, UntilExecuting, UntilExpired, WhileExecuting

Class Method Summary collapse

Class Method Details

.lookup(strategy) ⇒ Object



17
18
19
20
21
# File 'lib/active_job/uniqueness/strategies.rb', line 17

def lookup(strategy)
  matching_strategy(strategy.to_s.camelize) ||
    ActiveJob::Uniqueness.config.lock_strategies[strategy] ||
    raise(StrategyNotFound, "Strategy '#{strategy}' is not found. Is it declared in the configuration?")
end