class Orocos::RemoteProcesses::Process
Representation of a remote process started with ProcessClient#start
Attributes
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
Public Class Methods
# File lib/orocos/remote_processes/process.rb, line 17 def initialize(name, deployment_model, process_client, pid) @process_client = process_client @pid = pid @alive = true super(name, deployment_model) end
Public Instance Methods
True if the process is running. This is an alias for running?
# File lib/orocos/remote_processes/process.rb, line 51 def alive?; @alive end
Called to announce that this process has quit
# File lib/orocos/remote_processes/process.rb, line 30 def dead! @alive = false end
A string describing the host. It can be used to check if two processes are running on the same host
# File lib/orocos/remote_processes/process.rb, line 10 def host_id; process_client.host_id end
Wait for the
# File lib/orocos/remote_processes/process.rb, line 46 def join process_client.join(name) end
Stops the process
# File lib/orocos/remote_processes/process.rb, line 41 def kill(wait = true) process_client.stop(name, wait) end
True if this process is located on the same machine than the ruby interpreter
# File lib/orocos/remote_processes/process.rb, line 13 def on_localhost?; process_client.host == 'localhost' end
Retunging the Process name of the remote process
# File lib/orocos/remote_processes/process.rb, line 25 def process self end
Resolve all tasks within the deployment
A deployment is usually considered ready when all its tasks can be resolved successfully
# File lib/orocos/remote_processes/process.rb, line 59 def resolve_all_tasks(cache = Hash.new) Orocos::Process.resolve_all_tasks(self, cache) do |task_name| task(task_name) end end
True if the process is running. This is an alias for alive?
# File lib/orocos/remote_processes/process.rb, line 53 def running?; @alive end
Returns the task context object for the process' task that has this name
# File lib/orocos/remote_processes/process.rb, line 36 def task(task_name) process_client.name_service.get(task_name, process: self) 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/remote_processes/process.rb, line 67 def wait_running(timeout = nil) Orocos::Process.wait_running(self, timeout) end