Class: SolidQueue::Configuration
- Inherits:
-
Object
- Object
- SolidQueue::Configuration
- 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
-
#initialize(**options) ⇒ Configuration
constructor
A new instance of Configuration.
- #max_number_of_threads ⇒ Object
Constructor Details
#initialize(**options) ⇒ Configuration
Returns a new instance of Configuration.
28 29 30 |
# File 'lib/solid_queue/configuration.rb', line 28 def initialize(**) @options = .with_defaults() end |
Instance Method Details
#configured_processes ⇒ Object
32 33 34 35 36 37 |
# File 'lib/solid_queue/configuration.rb', line 32 def configured_processes if only_work? then workers else dispatchers + workers + schedulers end end |
#max_number_of_threads ⇒ Object
39 40 41 42 |
# File 'lib/solid_queue/configuration.rb', line 39 def max_number_of_threads # At most "threads" in each worker + 1 thread for the worker + 1 thread for the heartbeat task .map { || [:threads] }.max + 2 end |