next up previous contents
Next: Asynchronous Message-Passing Up: Client-Side Programming Previous: Functional-Reactive Page Generation   Contents

Remote Procedure Calls

Any function call may be made a client-to-server ``remote procedure call'' if the function being called needs no features that are only available to client code. To make a function call an RPC, pass that function call as the argument to $ \mathsf{Basis.rpc}$ :

\begin{displaymath}\begin{array}{l}
\mathsf{val} \; \mathsf{rpc} : \mathsf{t} :...
...; \mathsf{t} \to \mathsf{transaction} \; \mathsf{t}
\end{array}\end{displaymath}

There is an alternate form that uses $ \mathsf{None}$ to indicate that an error occurred during RPC processing, rather than raising an exception to abort this branch of control flow.

\begin{displaymath}\begin{array}{l}
\mathsf{val} \; \mathsf{tryRpc} : \mathsf{t...
...hsf{transaction} \; (\mathsf{option} \; \mathsf{t})
\end{array}\end{displaymath}



2014-07-14