class Delayed::Master::Config

Constants

CALLBACK_CONFIGS
SIMPLE_CONFIGS

Attributes

data[R]
workers[R]

Public Class Methods

new(file = nil) click to toggle source
# File lib/delayed/master/config.rb, line 9
def initialize(file = nil)
  @data = {}
  @workers = []
  read(file) if file
end

Public Instance Methods

add_worker() { |worker| ... } click to toggle source
# File lib/delayed/master/config.rb, line 23
def add_worker
  worker = WorkerSetting.new(id: @workers.size, queues: [], count: 1, exit_on_complete: true)
  yield worker
  @workers << worker
end
callbacks() click to toggle source
# File lib/delayed/master/config.rb, line 29
def callbacks
  @data.select { |k, _| CALLBACK_CONFIGS.include?(k) }
end
read(file) click to toggle source
# File lib/delayed/master/config.rb, line 19
def read(file)
  instance_eval(File.read(file), file)
end
run_callback(key, *args) click to toggle source
# File lib/delayed/master/config.rb, line 33
def run_callback(key, *args)
  @data[key].call(*args)
end
worker_settings() click to toggle source
# File lib/delayed/master/config.rb, line 15
def worker_settings
  @workers
end