Class: Sidekiq::Extensions::DelayedModel
- Inherits:
-
Object
- Object
- Sidekiq::Extensions::DelayedModel
- Includes:
- Worker
- Defined in:
- lib/sidekiq/extensions/active_record.rb
Overview
Adds a ‘delay’ method to ActiveRecord to offload arbitrary method execution to Sidekiq. Examples:
User.delay.delete_inactive User.recent_signups.each { |user| user.delay.mark_as_awesome }
Instance Method Summary collapse
Methods included from Worker
Instance Method Details
#perform(yml) ⇒ Object
14 15 16 17 |
# File 'lib/sidekiq/extensions/active_record.rb', line 14 def perform(yml) (target, method_name, args) = YAML.load(yml) target.send(method_name, *args) end |