3.14.7.4. Remote Lush Execution
(lsh/libstd/remote.lsh)


Lush provides facilities for controlling multiple Lush processes running on different machines.

The script lushslave starts Lush in slave mode. It first prints the host name and a port number and then waits for a connection. A master instance of Lush can use class RemoteLush to establish a connection, send commands, obtain the results, and check for errors.



3.14.7.4.0. (new RemoteLush host [port])
[CLASS] (lsh/libstd/remote.lsh)


Creates a remote lush connection to the slave instance of Lush running on the specified host and port . The default port is 4000. Commands can then be submitted using method exec .

Slot status indicates the outcome of the last command execution. Value ok indicates that the command was successful. Value error indicates that an error was detected. The error message is then available in slot error .

Slot fin can be used in command socketselect in order to determine whether the command output is available, and possibly wait for several remote processes.



3.14.7.4.1. (==> remotelush exec command)
[MSG] (lsh/libstd/remote.lsh)


Executes command command on the remote Lush process. The lisp object command is evaluated in the remote Lush process. Method exec returns the result of this evaluation.

When the remote evaluation causes an error, method exec sets the slot status to error and returns the symbol error . The error message is then available in slot error .

This method works by calling methods send and receive .



3.14.7.4.2. (==> remotelush send command)
[MSG] (lsh/libstd/remote.lsh)


Sends command command to the remote Lush process and returns immediatly. Slot status is set to the empty list until method receive is called.

3.14.7.4.3. (==> remotelush receive [nowait])
[MSG] (lsh/libstd/remote.lsh)


Receive the result of the remote execution of a command.

Method receive returns the result of the evaluation of a remote command submitted with method send . When the remote evaluation causes an error, method exec sets the slot status to error and returns the symbol error . The error message is then available in slot error .

Method receive usually waits for the execution of the remote command. This can be changed by setting argument nowait to true. Method receive then immediately returns the empty list if the result is not yet available. In this case, slot status remains set to the empty list.



3.14.7.4.4. (==> remotelush print)
[MSG] (lsh/libstd/remote.lsh)


Prints informative stuff.