Module: Sidekiq::CurrentAttributes
- Defined in:
- lib/sidekiq/middleware/current_attributes.rb
Overview
Automatically save and load any current attributes in the execution context so context attributes “flow” from Rails actions into any associated jobs. This can be useful for multi-tenancy, i18n locale, timezone, any implicit per-request attribute. See ActiveSupport::CurrentAttributes.
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.persist(klass) ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/sidekiq/middleware/current_attributes.rb', line 47 def self.persist(klass) Sidekiq.configure_client do |config| config.client_middleware.add Save, klass end Sidekiq.configure_server do |config| config.client_middleware.add Save, klass config.server_middleware.add Load, klass end end |