class Attache::Job

Constants

RETRY_DURATION

Public Class Methods

perform_async(*args) click to toggle source
# File lib/attache/job.rb, line 21
def self.perform_async(*args)
  self.new.async.perform(*args)
end
perform_in(duration, *args) click to toggle source
# File lib/attache/job.rb, line 24
def self.perform_in(duration, *args)
  self.new.async.later(duration, *args)
end

Public Instance Methods

later(sec, *args) click to toggle source
# File lib/attache/job.rb, line 18
def later(sec, *args)
  after(sec) { perform(*args) }
end
perform(method, env, args) click to toggle source
# File lib/attache/job.rb, line 4
def perform(method, env, args)
  config = Attache::VHost.new(env)
  config.send(method, args.symbolize_keys)
rescue Exception
  Attache.logger.error $@
  Attache.logger.error $!
  Attache.logger.error [method, args].inspect
  self.class.perform_in(RETRY_DURATION, method, env, args)
end