Module: SidekiqUniqueJobs::Script::DSL::ClassMethods
- Defined in:
- lib/sidekiq_unique_jobs/script/dsl.rb
Overview
Module ClassMethods extends the base class with necessary methods
Instance Method Summary collapse
-
#config ⇒ Script::Config
The current configuration (See: #configure on how to configure).
-
#configure(options = {}) { ... } ⇒ Object
Configure the gem.
- #execute(file_name, conn, keys: [], argv: []) ⇒ Object
Instance Method Details
#config ⇒ Script::Config
The current configuration (See: #configure on how to configure)
52 53 54 55 56 |
# File 'lib/sidekiq_unique_jobs/script/dsl.rb', line 52 def config MUTEX.synchronize do @config ||= Config.new end end |
#configure(options = {}) { ... } ⇒ Object
Configure the gem
This is usually called once at startup of an application
36 37 38 39 40 41 42 43 44 |
# File 'lib/sidekiq_unique_jobs/script/dsl.rb', line 36 def configure( = {}) if block_given? yield config else .each do |key, val| config.send(:"#{key}=", val) end end end |
#execute(file_name, conn, keys: [], argv: []) ⇒ Object
23 24 25 26 27 |
# File 'lib/sidekiq_unique_jobs/script/dsl.rb', line 23 def execute(file_name, conn, keys: [], argv: []) SidekiqUniqueJobs::Script::Client .new(config) .execute(file_name, conn, keys: keys, argv: argv) end |