Class: Rocketman::Pool

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rocketman/pool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePool

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

#jobsObject (readonly)

Returns the value of attribute jobs.



8
9
10
# File 'lib/rocketman/pool.rb', line 8

def jobs
  @jobs
end