Class: SolidQueue::Configuration
- Inherits:
-
Object
- Object
- SolidQueue::Configuration
- Includes:
- ActiveModel::Model
- Defined in:
- lib/solid_queue/configuration.rb
Defined Under Namespace
Classes: Process
Constant Summary collapse
- WORKER_DEFAULTS =
{ queues: "*", threads: 3, processes: 1, polling_interval: 0.1 }
- DISPATCHER_DEFAULTS =
{ batch_size: 500, polling_interval: 1, concurrency_maintenance: true, concurrency_maintenance_interval: 600 }
- DEFAULT_CONFIG_FILE_PATH =
"config/queue.yml"
- DEFAULT_RECURRING_SCHEDULE_FILE_PATH =
"config/recurring.yml"
Instance Method Summary collapse
- #configured_processes ⇒ Object
- #error_messages ⇒ Object
-
#initialize(**options) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(**options) ⇒ Configuration
Returns a new instance of Configuration.
34 35 36 |
# File 'lib/solid_queue/configuration.rb', line 34 def initialize(**) @options = .with_defaults() end |
Instance Method Details
#configured_processes ⇒ Object
38 39 40 41 42 43 |
# File 'lib/solid_queue/configuration.rb', line 38 def configured_processes if only_work? then workers else dispatchers + workers + schedulers end end |
#error_messages ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/solid_queue/configuration.rb', line 45 def if configured_processes.none? "No workers or processed configured. Exiting..." else = invalid_tasks.map do |task| = task.errors..map { |msg| "\t#{msg}" }.join("\n") "#{task.key}:\n#{}" end .join("\n") "Invalid processes configured:\n#{}" end end |