3.14.7.4. Remote Lush Execution |
(lsh/libstd/remote.lsh) |
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) |
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) |
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) |
3.14.7.4.3. (==> remotelush receive [nowait]) |
[MSG] (lsh/libstd/remote.lsh) |
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) |