Class: Delayed::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/delayed/plugin.rb

Class Method Summary collapse

Class Method Details

.callbacks(&block) ⇒ Object


9
10
11
# File 'lib/delayed/plugin.rb', line 9

def self.callbacks(&block)
  self.callback_block = block
end

.inject!Object


13
14
15
16
17
18
# File 'lib/delayed/plugin.rb', line 13

def self.inject!
  unless @injected
    self.callback_block.call(Delayed::Worker.lifecycle) if self.callback_block
  end
  @injected = true
end

.reset!Object


20
21
22
# File 'lib/delayed/plugin.rb', line 20

def self.reset!
  @injected = false
end