Module: Sidekiq::Antidote
- Extended by:
- Forwardable
- Defined in:
- lib/sidekiq/antidote.rb,
lib/sidekiq/antidote/web.rb,
lib/sidekiq/antidote/config.rb,
lib/sidekiq/antidote/remedy.rb,
lib/sidekiq/antidote/version.rb,
lib/sidekiq/antidote/inhibitor.rb,
lib/sidekiq/antidote/repository.rb,
lib/sidekiq/antidote/class_qualifier.rb,
lib/sidekiq/antidote/middlewares/client.rb,
lib/sidekiq/antidote/middlewares/server.rb,
lib/sidekiq/antidote/middlewares/shared.rb
Defined Under Namespace
Modules: Middlewares, Web Classes: ClassQualifier, Config, Inhibitor, Remedy, Repository
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
- .add(treatment: , class_qualifier: ) ⇒ Object
-
.configure {|config| ... } ⇒ Object
Yields ‘config` for a block.
- .delete(*ids) ⇒ Object
-
.inhibitors ⇒ Array<Inhibitor>
Live list of inhibitors.
- .log(severity) ⇒ nil
- .remedy_for(job_record) ⇒ Inhibitor?
-
.shutdown ⇒ self
Shutdown inhibitors poller.
-
.startup ⇒ self
Starts inhibitors poller.
Class Method Details
.add(treatment: , class_qualifier: ) ⇒ Object
29 |
# File 'lib/sidekiq/antidote.rb', line 29 def_delegators :@repository, :add |
.configure {|config| ... } ⇒ Object
Yields ‘config` for a block.
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/sidekiq/antidote.rb', line 56 def configure MUTEX.synchronize do config = @config.dup yield config @config = config.freeze self ensure reinit_remedy end end |
.delete(*ids) ⇒ Object
34 |
# File 'lib/sidekiq/antidote.rb', line 34 def_delegators :@repository, :delete |
.inhibitors ⇒ Array<Inhibitor>
Returns Live list of inhibitors.
37 38 39 |
# File 'lib/sidekiq/antidote.rb', line 37 def inhibitors @repository.to_a end |
.log(severity) ⇒ nil
91 92 93 94 |
# File 'lib/sidekiq/antidote.rb', line 91 def log(severity) Sidekiq.logger.public_send(severity) { "sidekiq-antidote: #{yield}" } nil end |
.remedy_for(job_record) ⇒ Inhibitor?
44 45 46 |
# File 'lib/sidekiq/antidote.rb', line 44 def remedy_for(job_record) @remedy.find { _1.match?(job_record) } end |
.shutdown ⇒ self
Shutdown inhibitors poller.
82 83 84 85 86 |
# File 'lib/sidekiq/antidote.rb', line 82 def shutdown MUTEX.synchronize { @remedy.stop_refresher } self end |
.startup ⇒ self
Starts inhibitors poller.
73 74 75 76 77 |
# File 'lib/sidekiq/antidote.rb', line 73 def startup MUTEX.synchronize { reinit_remedy.start_refresher } self end |