Module Async_rpc_kernel__Versioned_rpc.Callee_converts.Rpc.Make

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
        

Parameters

Model : sig ... end

Signature

module Register : functor (Version_i : sig ... end) -> sig ... end

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

include S with type query := Model.query with type response := Model.response
type query
type response
val implement_multi : ?log_not_previously_seen_version:(name:string ‑> int ‑> unit) ‑> ('state ‑> version:int ‑> query ‑> response Async_kernel.Deferred.t) ‑> 'state Async_rpc_kernel.Rpc.Implementation.t list

implement multiple versions at once

val rpcs : unit ‑> Async_rpc_kernel.Rpc.Any.t list

All rpcs implemented by implement_multi

val versions : unit ‑> Core_kernel.Int.Set.t

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

val name : string