Representation of a remote process started with Orocos::ProcessClient#start
The Orocos::Generation::StaticDeployment instance that describes this process
The deployment name
a mapping from the original to the new name
The process ID of this process on the machine of the process server
The ProcessClient instance that gives us access to the remote process server
# File lib/orocos/process_server.rb, line 606 def initialize(name, process_client, pid, prefix = nil) @name = name @process_client = process_client @pid = pid @alive = true @model = process_client.load_orogen_deployment(name) @name_mappings = Hash.new if prefix @model.task_activities.each do |task| map_name(task.name, "#{prefix}#{task.name}") end end end
True if the process is running. This is an alias for running?
# File lib/orocos/process_server.rb, line 661 def alive?; @alive end
Called to announce that this process has quit
# File lib/orocos/process_server.rb, line 630 def dead! @alive = false end
# File lib/orocos/process_server.rb, line 638 def get_mapped_name(name) name_mappings[name] || name end
A string describing the host. It can be used to check if two processes are running on the same host
# File lib/orocos/process_server.rb, line 594 def host_id process_client.host_id end
Wait for the
# File lib/orocos/process_server.rb, line 656 def join raise NotImplementedError, "RemoteProcess#join is not implemented" end
Stops the process
# File lib/orocos/process_server.rb, line 650 def kill(wait = true) raise ArgumentError, "cannot call RemoteProcess#kill(true)" if wait process_client.stop(name) end
# File lib/orocos/process_server.rb, line 621 def log_all_ports(options = Hash.new) Orocos.log_all_ports(self, options) end
# File lib/orocos/process_server.rb, line 634 def map_name(old, new) name_mappings[old] = new end
True if this process is located on the same machine than the ruby interpreter
# File lib/orocos/process_server.rb, line 599 def on_localhost? process_client.host == 'localhost' end
True if the process is running. This is an alias for alive?
# File lib/orocos/process_server.rb, line 663 def running?; @alive end
# File lib/orocos/process_server.rb, line 625 def setup_logger(options = Hash.new) Orocos.setup_default_logger(self, options) end
# File lib/orocos/process_server.rb, line 642 def task_names model.task_activities.map do |task| name = task.name get_mapped_name(name) end end
Waits for the deployment to be ready. timeout is the number of
milliseconds we should wait. If it is nil, will wait indefinitely
# File lib/orocos/process_server.rb, line 667 def wait_running(timeout = nil) Orocos::Process.wait_running(self, timeout) end