Plasma GitLab Archive
Projects Blog Knowledge

Module Rpc_proxy


module Rpc_proxy: sig .. end
RPC proxies


The Rpc_proxy module provides an improved reliability layer on top of Rpc_client. This layer especially features:
  • automatic connection management: TCP connections are started and terminated as needed
  • multiple connections can be held in parallel to a remote server to increase concurrency on the server side
  • failover to other servers when the orignal servers time out
  • support for an initial ping at connection establishment time to test the availability of the connection
  • retransmission of idempotent RPC calls
Proxies can only handle stream connections (TCP and Unix Domain). Also, the remote endpoints must already be specified by socket addresses. (No portmapper and other indirect lookup methods.)

Ideally, RPC calls look like local procedure calls. Because of failures and timeouts, they are fundamentally less reliable. The proxy layer adds some techniques that improve the reliability again. However, the same level as local calls provide cannot be reached.

In particular, network errors and timeouts are normally not hidden from the user. The semantics of RPC calls may change when they are repeated, especially when this is done on alternate network connections. The simple case of idempotent procedures is better handled, however: By definition, idempotent procedures can be again called without changing the semantics. The proxy layer supports this.

The proxy can be used together with the language mapping layer generated by ocamlrpcgen. Just do

 module M = F_clnt.Make'P(Rpc_proxy.ManagedClient) 

to get language-mapped procedure calls (where F_clnt is the generated client module, and P is the name of the program).

module ReliabilityCache: sig .. end
module ManagedClient: sig .. end
module ManagedSet: sig .. end
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml