Class: Rocketman::Pool
- Inherits:
-
Object
- Object
- Rocketman::Pool
- Includes:
- Singleton
- Defined in:
- lib/rocketman/pool.rb
Instance Attribute Summary collapse
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
Instance Method Summary collapse
-
#initialize ⇒ Pool
constructor
A new instance of Pool.
Constructor Details
#initialize ⇒ Pool
Returns a new instance of Pool.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rocketman/pool.rb', line 10 def initialize worker_count = Rocketman.configuration.worker_count latency = Rocketman.configuration.latency @latency = latency @jobs = Rocketman::JobQueue.new @workers = [] worker_count.times do @workers << spawn_worker end # spawn_supervisor # TODO: Write a supervisor to monitor workers health, and restart if necessary end |
Instance Attribute Details
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
8 9 10 |
# File 'lib/rocketman/pool.rb', line 8 def jobs @jobs end |