Module: Rworkflow::SidekiqHelper
- Included in:
- Worker
- Defined in:
- lib/rworkflow/sidekiq_helper.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .configure_client(host, port, db) ⇒ Object
- .configure_server(host, port, db) ⇒ Object
- .included(klass) ⇒ Object
- .queue_sizes ⇒ Object
Class Method Details
.configure_client(host, port, db) ⇒ Object
43 44 45 46 47 |
# File 'lib/rworkflow/sidekiq_helper.rb', line 43 def configure_client(host, port, db) Sidekiq.configure_client do |config| config.redis = { url: "redis://#{host}:#{port}/#{db}", namespace: 'sidekiq' } end end |
.configure_server(host, port, db) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/rworkflow/sidekiq_helper.rb', line 34 def configure_server(host, port, db) Sidekiq.configure_server do |config| config.redis = { url: "redis://#{host}:#{port}/#{db}", namespace: 'sidekiq' } config.server_middleware do |chain| chain.add SidekiqServerMiddleware end end end |
.included(klass) ⇒ Object
5 6 7 |
# File 'lib/rworkflow/sidekiq_helper.rb', line 5 def self.included(klass) klass.send :extend, ClassMethods end |
.queue_sizes ⇒ Object
49 50 51 52 |
# File 'lib/rworkflow/sidekiq_helper.rb', line 49 def queue_sizes stats = Sidekiq::Stats.new return stats.queues end |