Basic building blocks for the creation of RPC clients are provided by
(rpc rpc) module. The easiest way to build an RPC client
Return a procedure that may be applied to a list of arguments, transaction ID (any unsigned number representable on 32 bits), and I/O port, to make a synchronous RPC call to the remote procedure numbered procedure in program, version version. On success, the invocation result is eventually returned. Otherwise, an error condition is raised. arg-type and result-type should be XDR type objects (see XDR Type Representations).
Error conditions that may be raised include those related to XDR encoding and decoding (see XDR Encoding and Decoding), as well as RPC-specific error conditions inheriting from
&rpc-error(i.e., conditions that pass the
rpc-error?predicate). These are detailed in
For an example, see Creating the Client.
It is also possible to create “one-way” calls, i.e., RPC calls that do
not expect a reply (i.e., no return value, not even
is useful, for instance, to implement batched calls where clients do not
wait for the server to reply (see Section 7.4.1 of RFC 1831). Asynchronous calls can be implemented in terms of this, too.