Class: RubySupervisor::Client
- Inherits:
-
Object
- Object
- RubySupervisor::Client
- Includes:
- GlobalAPI, ProcessAPI, ProcessGroupAPI
- Defined in:
- lib/ruby-supervisor/api.rb
Overview
Main class, one client is connected to one supervisor instance.
Constant Summary
Constants included from GlobalAPI
Instance Method Summary collapse
-
#check_api_version ⇒ Object
Check that the API version is supported.
-
#initialize(address = '127.0.0.1', port = 9001, params = {}) ⇒ Client
constructor
A new instance of Client.
Methods included from GlobalAPI
#api_version, #clear_log, #clear_processes_logs, #identification, #pid, #processes, #read_log, #restart, #send_remote_comm_event, #shutdown, #start_processes, #state, #stop_processes, #version
Methods included from ProcessGroupAPI
Methods included from ProcessAPI
Constructor Details
#initialize(address = '127.0.0.1', port = 9001, params = {}) ⇒ Client
Returns a new instance of Client.
24 25 26 27 28 29 30 31 32 |
# File 'lib/ruby-supervisor/api.rb', line 24 def initialize(address = '127.0.0.1', port = 9001, params = {}) params = params.merge( :host => address, :port => port ) @xmlrpc_client = XMLRPC::Client.new3(params) check_api_version() end |
Instance Method Details
#check_api_version ⇒ Object
Check that the API version is supported.
37 38 39 40 41 42 |
# File 'lib/ruby-supervisor/api.rb', line 37 def check_api_version v = api_version() if v != "3.0" raise "unsupported API: #{v}" end end |