Class: Sidekiq::Extensions::DelayedClass

Inherits:
Object
  • Object
show all
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

#jid

Instance Method Summary collapse

Methods included from Worker

clear_all, drain_all, included, jobs, #logger

Instance Method Details

#perform(yml) ⇒ Object



15
16
17
18
# File 'lib/sidekiq/extensions/class_methods.rb', line 15

def perform(yml)
  (target, method_name, args) = YAML.load(yml)
  target.__send__(method_name, *args)
end