package babel

  1. Overview
  2. Docs

High level functions for working with callers in the style of Streamable.Plain_rpc.dispatch.

type ('q, 'r) dispatch := 'q -> 'r Core.Or_error.t Async_kernel.Deferred.t

Determine which supported dispatch strategy to use and invoke the chosen rpcs.

val singleton : ('q, 'r) Streamable.Plain_rpc.t -> ('q, 'r) dispatch t

Create a new caller supporting a single rpc.

val add : ('q, 'r) dispatch t -> rpc:('q, 'r) Streamable.Plain_rpc.t -> ('q, 'r) dispatch t

Add support for dispatching another rpc. dispatch_multi will prefer this rpc over the ones the caller already supports.

val map_query : ('q1, 'r) dispatch t -> f:('q2 -> 'q1) -> ('q2, 'r) dispatch t

A specialization of map for the query type of a protocol.

val map_response : ('q, 'r1) dispatch t -> f:('r1 -> 'r2) -> ('q, 'r2) dispatch t

A specialization of map for the response type of a protocol.

OCaml

Innovation. Community. Security.