class
Amber::Jobs::Configuration
- Amber::Jobs::Configuration
- Reference
- Object
Overview
Configuration settings for the background jobs system.
This class holds all configurable options for job processing, including the adapter type, queue names, worker count, polling interval, and work-stealing behavior.
Usage
Configuration is typically set through Amber::Server.configure:
Amber::Server.configure do |app|
app.jobs.adapter = :memory
app.jobs.queues = ["default", "critical", "low"]
app.jobs.workers = 2
app.jobs.work_stealing_enabled = true
app.jobs.polling_interval = 1.second
end
Or accessed directly:
config = Amber::Jobs.configuration
config.workers = 4
Defined in:
amber/jobs/configuration.crConstructors
Instance Method Summary
-
#adapter : Symbol
The adapter type for job queue storage.
-
#adapter=(adapter : Symbol)
The adapter type for job queue storage.
-
#is_auto_start_enabled=(is_auto_start_enabled : Bool)
Whether the jobs system should automatically start workers when the Amber server starts.
-
#is_auto_start_enabled? : Bool
Whether the jobs system should automatically start workers when the Amber server starts.
-
#is_work_stealing_enabled=(is_work_stealing_enabled : Bool)
Whether idle web server instances should process background jobs.
-
#is_work_stealing_enabled? : Bool
Whether idle web server instances should process background jobs.
-
#list_of_queues : Array(String)
The list of queue names to process, in priority order.
-
#list_of_queues=(list_of_queues : Array(String))
The list of queue names to process, in priority order.
-
#number_of_workers : Int32
The number of worker fibers to spawn.
-
#number_of_workers=(number_of_workers : Int32)
The number of worker fibers to spawn.
-
#polling_interval : Time::Span
How frequently workers poll the queue adapter for available jobs.
-
#polling_interval=(polling_interval : Time::Span)
How frequently workers poll the queue adapter for available jobs.
-
#queues : Array(String)
Convenience getter that returns queue names.
-
#queues=(list_of_queues : Array(String))
Convenience setter that accepts an array of strings for queue names.
-
#scheduler_interval : Time::Span
How frequently the scheduler checks for jobs ready to be promoted.
-
#scheduler_interval=(scheduler_interval : Time::Span)
How frequently the scheduler checks for jobs ready to be promoted.
-
#work_stealing_enabled=(value : Bool)
Convenience setter for work stealing.
-
#work_stealing_enabled? : Bool
Convenience getter for work stealing.
-
#workers : Int32
Convenience getter for number of workers.
-
#workers=(count : Int32)
Convenience setter for number of workers.
Constructor Detail
Instance Method Detail
Whether the jobs system should automatically start workers when the Amber server starts. Default: false
Whether the jobs system should automatically start workers when the Amber server starts. Default: false
Whether idle web server instances should process background jobs. When enabled, the web server spawns additional workers that only pick up jobs when no HTTP requests are pending. Default: false
Whether idle web server instances should process background jobs. When enabled, the web server spawns additional workers that only pick up jobs when no HTTP requests are pending. Default: false
The list of queue names to process, in priority order. Workers will check queues in this order, processing the first available job. Default: ["default"]
The list of queue names to process, in priority order. Workers will check queues in this order, processing the first available job. Default: ["default"]
The number of worker fibers to spawn. Default: 1
How frequently workers poll the queue adapter for available jobs. Default: 1.second
How frequently workers poll the queue adapter for available jobs. Default: 1.second
Convenience setter that accepts an array of strings for queue names.
How frequently the scheduler checks for jobs ready to be promoted. Default: 5.seconds
How frequently the scheduler checks for jobs ready to be promoted. Default: 5.seconds