Module Pipe_rpc.Make

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 -->-´

Parameters

Signature

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

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

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

Register_raw is like Register except you get to deal with the whole pipe. This is useful if, e.g., your model_of_response function can fail, so that you'd like to filter items out from the result pipe.

include S with type query := Model.query with type response := Model.response with type error := Model.error
type query
type response
type error
val dispatch_multi : Connection_with_menu.t -> query -> (response Core_kernel.Or_error.t Async_kernel.Pipe.Reader.t * Rpc.Pipe_rpc.Metadata.terror) Core_kernel.Result.t Core_kernel.Or_error.t Async_kernel.Deferred.t
val dispatch_iter_multi : Connection_with_menu.t -> query -> f:(response Rpc.Pipe_rpc.Pipe_message.t -> Rpc.Pipe_rpc.Pipe_response.t) -> (Rpc.Pipe_rpc.Id.terror) Core_kernel.Result.t Core_kernel.Or_error.t Async_kernel.Deferred.t
val abort_multi : Connection_with_menu.t -> Rpc.Pipe_rpc.Id.t -> unit Core_kernel.Or_error.t
val rpcs : unit -> Rpc.Any.t list

All rpcs supported by dispatch_multi

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

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

val name : string