package async_rpc_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Given a model of the types involved in a family of Pipe_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

module Model : sig ... end

Signature

module type Version_shared = sig ... end
module Register (Version_i : sig ... end) : sig ... end

add a new version to the set of versions available via implement_multi or implement_direct.

module Register_raw (Version_i : sig ... end) : sig ... end

Register_raw is like Register except you get the whole pipe to deal with.

include S with type query := Model.query with type response := Model.response with type error := Model.error
val implement_multi : ?log_not_previously_seen_version:(name:string -> int -> unit) -> ('state -> version:int -> Model.query -> (Model.response Async_kernel.Pipe.Reader.t, Model.error) Core_kernel.Result.t Async_kernel.Deferred.t) -> 'state Rpc.Implementation.t list

implement multiple versions at once

val implement_direct_multi : ?log_not_previously_seen_version:(name:string -> int -> unit) -> ('state -> version:int -> Model.query -> Model.response Versioned_direct_stream_writer.t -> (unit, Model.error) Core_kernel.Result.t Async_kernel.Deferred.t) -> 'state Rpc.Implementation.t list

implement multiple versions at once, using a Versioned_direct_stream_writer

val rpcs : unit -> Rpc.Any.t list

All rpcs implemented by implement_multi

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

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

val name : string
OCaml

Innovation. Community. Security.