Class: Trident::PoolManager
- Inherits:
-
Object
- Object
- Trident::PoolManager
- Includes:
- GemLogger::LoggerSupport, Utils
- Defined in:
- lib/trident/pool_manager.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pools ⇒ Object
readonly
Returns the value of attribute pools.
-
#prefork ⇒ Object
readonly
Returns the value of attribute prefork.
Instance Method Summary collapse
-
#initialize(name, pools, prefork) ⇒ PoolManager
constructor
A new instance of PoolManager.
- #start ⇒ Object
- #stop_forcefully ⇒ Object
- #stop_gracefully ⇒ Object
- #update ⇒ Object
-
#wait ⇒ Object
waits for children to exit.
Methods included from Utils
Constructor Details
#initialize(name, pools, prefork) ⇒ PoolManager
Returns a new instance of PoolManager.
8 9 10 11 12 13 14 |
# File 'lib/trident/pool_manager.rb', line 8 def initialize(name, pools, prefork) logger.info "Initializing pool manager" procline "manager-#{name}", "(initializing)" @name = name @pools = pools @prefork = prefork end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/trident/pool_manager.rb', line 6 def name @name end |
#pools ⇒ Object (readonly)
Returns the value of attribute pools.
6 7 8 |
# File 'lib/trident/pool_manager.rb', line 6 def pools @pools end |
#prefork ⇒ Object (readonly)
Returns the value of attribute prefork.
6 7 8 |
# File 'lib/trident/pool_manager.rb', line 6 def prefork @prefork end |
Instance Method Details
#start ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/trident/pool_manager.rb', line 16 def start logger.info "Starting pools" load_handlers if prefork pools.each do |pool| pool.start end procline "manager", "managing #{procline_display}" end |
#stop_forcefully ⇒ Object
25 26 27 |
# File 'lib/trident/pool_manager.rb', line 25 def stop_forcefully stop('stop_forcefully') end |
#stop_gracefully ⇒ Object
29 30 31 |
# File 'lib/trident/pool_manager.rb', line 29 def stop_gracefully stop('stop_gracefully') end |
#update ⇒ Object
43 44 45 46 47 48 |
# File 'lib/trident/pool_manager.rb', line 43 def update pools.each do |pool| pool.update end procline "manager", "managing #{procline_display}" end |
#wait ⇒ Object
waits for children to exit
34 35 36 37 38 39 40 41 |
# File 'lib/trident/pool_manager.rb', line 34 def wait logger.info "Waiting for pools to exit" procline "manager", "waiting #{procline_display}" pools.each do |pool| pool.wait end :break end |