Class: Larva::WorkerPool
- Inherits:
-
Object
- Object
- Larva::WorkerPool
- Defined in:
- lib/larva/worker_pool.rb
Instance Attribute Summary collapse
-
#processors ⇒ Object
readonly
Returns the value of attribute processors.
-
#queue_suffix ⇒ Object
readonly
Returns the value of attribute queue_suffix.
-
#workers ⇒ Object
readonly
Returns the value of attribute workers.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(processors, queue_suffix) ⇒ WorkerPool
constructor
A new instance of WorkerPool.
- #start ⇒ Object
Constructor Details
#initialize(processors, queue_suffix) ⇒ WorkerPool
8 9 10 11 |
# File 'lib/larva/worker_pool.rb', line 8 def initialize(processors, queue_suffix) @processors = processors @queue_suffix = queue_suffix end |
Instance Attribute Details
#processors ⇒ Object (readonly)
Returns the value of attribute processors.
7 8 9 |
# File 'lib/larva/worker_pool.rb', line 7 def processors @processors end |
#queue_suffix ⇒ Object (readonly)
Returns the value of attribute queue_suffix.
7 8 9 |
# File 'lib/larva/worker_pool.rb', line 7 def queue_suffix @queue_suffix end |
#workers ⇒ Object (readonly)
Returns the value of attribute workers.
7 8 9 |
# File 'lib/larva/worker_pool.rb', line 7 def workers @workers end |
Class Method Details
.start(processors, queue_suffix) ⇒ Object
3 4 5 |
# File 'lib/larva/worker_pool.rb', line 3 def self.start(processors, queue_suffix) new(processors, queue_suffix).start end |
Instance Method Details
#start ⇒ Object
13 14 15 16 |
# File 'lib/larva/worker_pool.rb', line 13 def start start_workers keep_workers_alive if workers.count > 0 end |