class Orocos::RemoteProcesses::Process

Representation of a remote process started with ProcessClient#start

Attributes

pid[R]

The process ID of this process on the machine of the process server

process_client[R]

The ProcessClient instance that gives us access to the remote process server

Public Class Methods

new(name, deployment_model, process_client, pid) click to toggle source
Calls superclass method Orocos::ProcessBase.new
# 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

alive?() click to toggle source

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
dead!() click to toggle source

Called to announce that this process has quit

# File lib/orocos/remote_processes/process.rb, line 30
def dead!
    @alive = false
end
host_id() click to toggle source

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
join() click to toggle source

Wait for the

# File lib/orocos/remote_processes/process.rb, line 46
def join
    process_client.join(name)
end
kill(wait = true) click to toggle source

Stops the process

# File lib/orocos/remote_processes/process.rb, line 41
def kill(wait = true)
    process_client.stop(name, wait)
end
on_localhost?() click to toggle source

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
process() click to toggle source

Retunging the Process name of the remote process

# File lib/orocos/remote_processes/process.rb, line 25
def process
    self
end
resolve_all_tasks(cache = Hash.new) click to toggle source

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
running?() click to toggle source

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
task(task_name) click to toggle source

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
wait_running(timeout = nil) click to toggle source

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