Module: Sidekiq::Pauzer
- Defined in:
- lib/sidekiq/pauzer.rb,
lib/sidekiq/pauzer/web.rb,
lib/sidekiq/pauzer/config.rb,
lib/sidekiq/pauzer/queues.rb,
lib/sidekiq/pauzer/version.rb,
lib/sidekiq/pauzer/repository.rb,
lib/sidekiq/pauzer/patches/queue.rb,
lib/sidekiq/pauzer/patches/web_action.rb,
lib/sidekiq/pauzer/patches/basic_fetch.rb,
lib/sidekiq/pauzer/patches/web_application.rb
Defined Under Namespace
Modules: Patches, Web Classes: Config, Queues, Repository
Constant Summary collapse
- VERSION =
"5.2.0"
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Object
Yields ‘config` for a block.
- .pause!(queue_name) ⇒ void
- .paused?(queue_name) ⇒ Boolean, void
-
.paused_queues ⇒ Array<String>
Eventually consistent list of paused queues.
- .shutdown ⇒ Object
- .startup ⇒ Object
- .unpause!(queue_name) ⇒ void
Class Method Details
.configure {|config| ... } ⇒ Object
Yields ‘config` for a block.
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/sidekiq/pauzer.rb', line 94 def configure MUTEX.synchronize do config = @config.dup yield config @config = config.freeze self ensure reinit_queues end end |
.pause!(queue_name) ⇒ void
This method returns an undefined value.
47 48 49 50 |
# File 'lib/sidekiq/pauzer.rb', line 47 def pause!(queue_name) @repository.add(queue_name) nil end |
.paused?(queue_name) ⇒ Boolean, void
71 72 73 |
# File 'lib/sidekiq/pauzer.rb', line 71 def paused?(queue_name) @repository.include?(queue_name) end |
.paused_queues ⇒ Array<String>
Eventually consistent list of paused queues.
82 83 84 |
# File 'lib/sidekiq/pauzer.rb', line 82 def paused_queues @queues.to_a end |
.shutdown ⇒ Object
114 115 116 117 118 |
# File 'lib/sidekiq/pauzer.rb', line 114 def shutdown MUTEX.synchronize { @queues.stop_refresher } self end |
.startup ⇒ Object
108 109 110 111 112 |
# File 'lib/sidekiq/pauzer.rb', line 108 def startup MUTEX.synchronize { reinit_queues.start_refresher } self end |
.unpause!(queue_name) ⇒ void
This method returns an undefined value.
60 61 62 63 |
# File 'lib/sidekiq/pauzer.rb', line 60 def unpause!(queue_name) @repository.delete(queue_name) nil end |