Read remote

Purpose: Get results of a service call.

 read-remote <service> \
     [ data <data> ] \
     [ error <error> ] \
     [ status <status> ] \
     [ status-text <status text> ] \
     [ handler-status <service status> ]

Use read-remote to get the results of call-remote created in new-remote; the same <service> must be used in all.

- Getting the reply from server
The service reply is split in two. One part is the actual result of processing (called "stdout" or standard output), and that is "data". The other is the error messages (called "stderr" or standard error), and that's "error". The standard output goes to "data", except from report-error and pf-out/pf-url/pf-web (with "to-error" clause) which goes to "error". Note that "data" and "error" streams can be co-mingled when output by the service, but they will be obtained separately. This allows for clean separation of output from any error messages.

<data> is the "data" reply of a service call (in "data" clause). <error> is the "error" reply (in "error" clause).

- Getting status of a service call
The status of a service call (as a number) can be obtained in <status> (in "status" clause). This is the protocol status, and it may be:
You can also obtain the status text in <status text> (in "status-text" clause); this is a human readable status message which is am empty string (i.e. "") if there is no error (meaning if <status> is GG_OKAY).

- Getting service status
<service status> (in "handler-status" clause) is the return status (as a number) of the code executing a remote service handler; it is conceptually similar to a return value from a function (as a number). The particular service handler you are calling may or may not return the status; it it does, its return status can be sent back via handler-status and/or exit-handler statement.

You must specify at least one value to obtain in read-remote, or any number of them.
Examples
See examples in new-remote and call-remote.
See also
Distributed computing
call-remote  
new-remote  
read-remote  
run-remote  
See all
documentation


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.