Module Std.Versioned_rpc

module Versioned_rpc: Versioned_rpc


This module contains infrastructure code for managing RPCs which evolve over time to use different types at different versions. Two scenarios are supported

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
machinery for communicating names and versions of supported rpcs from within the rpc protocol itself.
val ounit_tests : unit -> OUnit.test

multi-version dispatch

all versions supported by dispatch_multi. (useful for computing which old versions may be pruned)

Given a model of the types involved in a family of RPCs, this functor provides a single RPC versioned dispatch function 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 -->-'
     


add a new version to the set of versions available via dispatch_multi.

multi-version dispatch

all versions supported by dispatch_multi. (useful for computing which old versions may be pruned)

Given a model of the types involved in a family of Pipe_RPCs, this functor provides a single Pipe_RPC versioned dispatch function 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 -->-'
     


add a new version to the set of versions available via dispatch_multi.

implement multiple versions at once

all versions implemented by implement_multi (useful for computing which old versions may be pruned)

Given a model of the types involved in a family of RPCs, this functor provides a single multi-version implementation function 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
   


add a new version to the set of versions implemented by implement_multi.

machinery for communicating names and versions of supported rpcs from within the rpc protocol itself.

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