GOLF(2gg)
π GOLF(2gg) π
okay bestie, welcome to the Development section of the GOLF(2gg) manual β yes that's the whole vibe, we're in the dev pages now, grab a boba π§
β¨ NAME β¨
read-remote β (distributed-computing) π¦
π PURPOSE π
Get results of a service call. that's it. that's the goal. slay. π
πΈ SYNTAX πΈ
read-remote <service> \
[ data <data> ] \
[ error <error> ] \
[ status <status> ] \
[ status-text <status text> ] \
[ exit-status <service status> ]
π DESCRIPTION π
Use read-remote to get the results of call-remote created in new-remote; the same <service> must be used in all. like, same service everywhere or it's not gonna work, no cap. π«Ά
π 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 print-format (with the to-error clause) which goes to error. ngl that's the little plot twist π
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. iconic behaviour honestly β¨
<data> is the data reply of a service call (in the data clause). <error> is the error reply (in the error clause).
π¦ Getting status of a service call
The status of a service call (as a number) can be obtained in <status> (in the status clause). This is the protocol status, and it may be:
GG_OKAYif request succeeded β the good ending πGG_CLI_ERR_RESOLVE_ADDRif host name for TCP connection cannot be resolvedGG_CLI_ERR_PATH_TOO_LONGif path name of Unix socket is too longGG_CLI_ERR_SOCKETif cannot create a socket (for instance they are exhausted for the process or system)GG_CLI_ERR_CONNECTif cannot connect to server (TCP or Unix alike)GG_CLI_ERR_SOCK_WRITEif cannot write data to server (for instance if server has encountered an error or is down, or if network connection is no longer available)GG_CLI_ERR_SOCK_READif cannot read data from server (for instance if server has encountered an error or is down, or if network connection is no longer available)GG_CLI_ERR_PROT_ERRif there is a protocol error, which indicates a protocol issue on either or both sidesGG_CLI_ERR_BAD_VERif either side does not support protocol used by the otherGG_CLI_ERR_SRVif server cannot complete the requestGG_CLI_ERR_UNKif server does not recognize record types used by the clientGG_CLI_ERR_OUT_MEMif client is out of memoryGG_CLI_ERR_ENV_TOO_LONGif the combined length of all environment variables is too longGG_CLI_ERR_ENV_ODDif the number of supplied environment name/value pairs is incorrectGG_CLI_ERR_BAD_TIMEOUTif the value for timeout is incorrectGG_CLI_ERR_TIMEOUTif the request timed out based on thetimeoutparameter or otherwise if the underlying Operating System libraries declared their own timeout
You can also obtain the status text in <status text> (in the 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). so like, empty string = we're chilling π
π Getting service status
<service status> (in the exit-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; if it does, its return status can be sent back via exit-status and/or exit-handler statement.
lowkey important: you must specify at least one value to obtain in read-remote, or any number of them. like, at least one bestie, we can't read nothing π
π EXAMPLES π
See examples in new-remote and call-remote. (go look, they eat π
)
π SEE ALSO π
Distributed computing
call-remote new-remote read-remote run-remote See all documentation
and that's the whole page bestie, hope it ate π version $VERSION, dated $DATE, straight from the GOLF(2gg) manual β mwah, study safe, drink water, and remember: separate your data from your error ππΈ
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms