module Versioned_rpc:sig
..end
The proto-typical example of this scenario is a commander that needs to call out to many assistants for that same system. In this scenario, the assistants each implement a single version of the rpc and the commander has to take this into account.
The proto-typical example of this scenario is an assistant from one system calling out the commander of another system In this scenario, the assistants each know a single version of the rpc to call and the commander has to implement them all.
In each scenario, it is desirable that the party responsible for
managing versions be coded largely in terms of a single "master"
version of the types involved, with all necessary type conversions
relegated to a single module. Versioned_rpc
is intended for
implementing such a module.
Type coercions into and out of the model go in the directions indicated by the following diagram:
Caller converts Callee converts =============== =============== caller callee | callee | callee | | caller | | callee | | | | | | ,-->-- Q1 --> R1 -->-. Q1 -->-. | ,-->-- R1 / \ \ | / Q --->-- Q2 --> R2 -->-- R Q2 -->-- Q --> R --->-- R2 \ / / \ `-->-- Q3 --> R3 -->-' Q3 -->-' `-->-- R3
module Caller_converts:sig
..end
module Callee_converts:sig
..end
module Menu:sig
..end
val ounit_tests : unit -> OUnit.test
dispatch_multi
.
(useful for computing which old versions may be pruned)dispatch_multi
in terms of that model and a mechanism for registering the individual
versions that dispatch_multi
knows about. Registration requires
knowing how to get into and out of the model.
,-->-- Q1 --> R1 -->-. / \ Q --->-- Q2 --> R2 -->-- R \ / `-->-- Q3 --> R3 -->-'
dispatch_multi
.dispatch_multi
.
(useful for computing which old versions may be pruned)dispatch_multi
in terms of that model and a mechanism
for registering the individual versions that dispatch_multi
knows about. Registration requires knowing how to get into and
out of the model.
,-->-- Q1 --> R1 -->-. E1 -->-. / \ \ Q --->-- Q2 --> R2 -->-- R E2 -->-- E \ / / `-->-- Q3 --> R3 -->-' E3 -->-'
dispatch_multi
.implement_multi
(useful for computing which old versions may be pruned)implement_multi
in terms of that model and a mechanism for
registering the individual versions that implement_multi
knows
about. Registration requires knowing how to get into and out of
the model.
Q1 -->-. ,-->-- R1 \ / Q2 -->-- Q --> R --->-- R2 / \ Q3 -->-' `-->-- R3
implement_multi
.
This is useful for dynamically determining the most appropriate version number
to pass dispatch_multi
. when using Caller_converts
-style versioned rpcs
a directory of supported rpc names and versions.
add impls
extends a list of rpc implementations with an additional
rpc implementation for providing a Menu.t
when one is requested
via Menu.request
.
request an rpc version menu from an rpc connection
find what rpcs are supported
find what versions of a particular rpc are supported