Class: SolidQueue::Worker
- Inherits:
-
Processes::Poller
- Object
- Processes::Base
- Processes::Poller
- SolidQueue::Worker
- Includes:
- LifecycleHooks
- 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.
Attributes inherited from Processes::Poller
Attributes inherited from Processes::Base
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::Registrable
Methods included from Processes::Interruptible
Methods included from Processes::Procline
Constructor Details
#initialize(**options) ⇒ Worker
Returns a new instance of Worker.
12 13 14 15 16 17 18 19 |
# File 'lib/solid_queue/worker.rb', line 12 def initialize(**) = .dup.with_defaults(SolidQueue::Configuration::WORKER_DEFAULTS) @queues = Array([:queues]) @pool = Pool.new([:threads], on_idle: -> { wake_up }) super(**) end |
Instance Attribute Details
#pool ⇒ Object
Returns the value of attribute pool.
10 11 12 |
# File 'lib/solid_queue/worker.rb', line 10 def pool @pool end |
#queues ⇒ Object
Returns the value of attribute queues.
10 11 12 |
# File 'lib/solid_queue/worker.rb', line 10 def queues @queues end |
Instance Method Details
#metadata ⇒ Object
21 22 23 |
# File 'lib/solid_queue/worker.rb', line 21 def super.merge(queues: queues.join(","), thread_pool_size: pool.size) end |