module Sidekiq::CurrentAttributes

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.

For multiple current attributes, pass an array of current attributes.

@example

# in your initializer
require "sidekiq/middleware/current_attributes"
Sidekiq::CurrentAttributes.persist("Myapp::Current")
# or multiple current attributes
Sidekiq::CurrentAttributes.persist(["Myapp::Current", "Myapp::OtherCurrent"])