package babel

  1. Overview
  2. Docs

High level functions for working with callees in the style of Streamable.Plain_rpc.implement.

type ('q, 'r) implementation := 'q -> 'r Core.Or_error.t Async_kernel.Deferred.t
val singleton : ('q, 'r) Streamable.Plain_rpc.t -> ('q, 'r) implementation t

Create a callee which can implement a given rpc.

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

Extend a callee to be able to implement a given rpc.

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

Map over the query type of a callee.

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

Map over the response type of a callee.

OCaml

Innovation. Community. Security.