Class: Sidekiq::Extensions::DelayedClass
- Inherits:
-
Object
- Object
- Sidekiq::Extensions::DelayedClass
- Includes:
- Worker
- Defined in:
- lib/sidekiq/extensions/class_methods.rb
Overview
Adds ‘delay’, ‘delay_for’ and ‘delay_until` methods to all Classes to offload class method execution to Sidekiq. Examples:
User.delay.delete_inactive Wikipedia.delay.download_changes_for(Date.today)
Instance Attribute Summary
Attributes included from Worker
Instance Method Summary collapse
Methods included from Worker
clear_all, drain_all, included, jobs, #logger
Instance Method Details
#perform(yml) ⇒ Object
16 17 18 19 |
# File 'lib/sidekiq/extensions/class_methods.rb', line 16 def perform(yml) (target, method_name, args) = YAML.load(yml) target.__send__(method_name, *args) end |