Class: Zeus::Server::Stage
- Inherits:
-
ForkedProcess
- Object
- ForkedProcess
- Zeus::Server::Stage
- Defined in:
- lib/zeus/server/stage.rb
Overview
NONE of the code in the module is run in the master process, so every communication to the master must be done with IPC.
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#stages ⇒ Object
Returns the value of attribute stages.
Attributes inherited from ForkedProcess
Instance Method Summary collapse
Methods inherited from ForkedProcess
#before_setup, #initialize, #newly_loaded_features, #notify_feature, #notify_new_features, #notify_started, #notify_terminated, #run, #setup_forked_process
Constructor Details
This class inherits a constructor from Zeus::Server::ForkedProcess
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
6 7 8 |
# File 'lib/zeus/server/stage.rb', line 6 def actions @actions end |
#stages ⇒ Object
Returns the value of attribute stages.
6 7 8 |
# File 'lib/zeus/server/stage.rb', line 6 def stages @stages end |
Instance Method Details
#after_notify ⇒ Object
21 22 23 24 25 26 |
# File 'lib/zeus/server/stage.rb', line 21 def after_notify @pids = {} @stages.each do |stage| @pids[stage.run] = stage end end |
#after_setup ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/zeus/server/stage.rb', line 13 def after_setup begin @actions.each(&:call) rescue => e handle_load_error(e) end end |
#descendent_acceptors ⇒ Object
8 9 10 |
# File 'lib/zeus/server/stage.rb', line 8 def descendent_acceptors @stages.map(&:descendent_acceptors).flatten end |
#runloop! ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/zeus/server/stage.rb', line 28 def runloop! loop do begin pid = Process.wait rescue Errno::ECHILD sleep # if this is a terminal node, just let acceptors run... end stage = @pids[pid] @pids[stage.run] = stage end end |