Class: ProxyMgr::Haproxy::Control
- Inherits:
-
Object
- Object
- ProxyMgr::Haproxy::Control
- Includes:
- Callbacks
- Defined in:
- lib/proxymgr/haproxy/control.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
Instance Method Summary collapse
-
#initialize(path, config_file) ⇒ Control
constructor
A new instance of Control.
- #restart(fds = []) ⇒ Object
- #start ⇒ Object
Methods included from Callbacks
Constructor Details
#initialize(path, config_file) ⇒ Control
Returns a new instance of Control.
8 9 10 11 12 13 14 15 |
# File 'lib/proxymgr/haproxy/control.rb', line 8 def initialize(path, config_file) @path = path @config_file = config_file @mutex = Mutex.new callbacks :on_stop end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
6 7 8 |
# File 'lib/proxymgr/haproxy/control.rb', line 6 def exit_code @exit_code end |
Instance Method Details
#restart(fds = []) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/proxymgr/haproxy/control.rb', line 21 def restart(fds = []) @mutex.synchronize do if @process run(@process.pid, fds) else run(nil, fds) end end end |
#start ⇒ Object
17 18 19 |
# File 'lib/proxymgr/haproxy/control.rb', line 17 def start restart end |