class Arsenicum::Configuration::QueueConfiguration

Attributes

router_class[R]
worker_count[R]

Public Class Methods

new(name) click to toggle source
# File lib/arsenicum/configuration.rb, line 95
def initialize(name)
  super(name)
  @worker_count = 2
end

Public Instance Methods

build() click to toggle source
# File lib/arsenicum/configuration.rb, line 120
def build
  klass.new(name, init_parameters.merge(worker_count: worker_count, router_class: router_class)).tap do |queue|
    task_configurations.each do |task_config|
      queue.register task_config.build
    end
  end
end
router(name) click to toggle source
# File lib/arsenicum/configuration.rb, line 100
def router(name)
  @router_class = constantize(classify(name))
rescue NameError
  @router_class = constantize(classify(name), inside: Arsenicum::Routing)
end
task(name, &block) click to toggle source
# File lib/arsenicum/configuration.rb, line 114
def task(name, &block)
  task_config = TaskConfiguration.new name
  task_config.instance_eval &block if block_given?
  task_configurations << task_config
end
task_configurations() click to toggle source
# File lib/arsenicum/configuration.rb, line 110
def task_configurations
  @task_configurations ||= []
end
workers(count) click to toggle source
# File lib/arsenicum/configuration.rb, line 106
def workers(count)
  @worker_count = count
end