Class: SolidQueue::Worker
- Inherits:
-
Processes::Base
- Object
- Processes::Base
- SolidQueue::Worker
- Includes:
- Processes::Poller
- Defined in:
- lib/solid_queue/worker.rb
Instance Attribute Summary collapse
-
#pool ⇒ Object
Returns the value of attribute pool.
-
#queues ⇒ Object
Returns the value of attribute queues.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Worker
constructor
A new instance of Worker.
- #metadata ⇒ Object
Methods included from Processes::Runnable
Methods included from Processes::Supervised
Methods inherited from Processes::Base
Methods included from AppExecutor
#handle_thread_error, #wrap_in_app_executor
Methods included from Processes::Interruptible
Methods included from Processes::Procline
Constructor Details
#initialize(**options) ⇒ Worker
Returns a new instance of Worker.
9 10 11 12 13 14 15 |
# File 'lib/solid_queue/worker.rb', line 9 def initialize(**) = .dup.with_defaults(SolidQueue::Configuration::WORKER_DEFAULTS) @polling_interval = [:polling_interval] @queues = Array([:queues]) @pool = Pool.new([:threads], on_idle: -> { wake_up }) end |
Instance Attribute Details
#pool ⇒ Object
Returns the value of attribute pool.
7 8 9 |
# File 'lib/solid_queue/worker.rb', line 7 def pool @pool end |
#queues ⇒ Object
Returns the value of attribute queues.
7 8 9 |
# File 'lib/solid_queue/worker.rb', line 7 def queues @queues end |
Instance Method Details
#metadata ⇒ Object
17 18 19 |
# File 'lib/solid_queue/worker.rb', line 17 def super.merge(queues: queues.join(","), thread_pool_size: pool.size) end |