package babel

  1. Overview
  2. Docs

Module Caller.Pipe_rpc_iterSource

High level functions for working with callers in the style of Async.Rpc.Pipe_rpc.dispatch_iter.

Sourcemodule Id : Core.T
type ('q, 'r, 'e) dispatch := 'q -> f: ('r Async_rpc_kernel.Rpc.Pipe_rpc.Pipe_message.t -> Async_rpc_kernel.Rpc.Pipe_rpc.Pipe_response.t) -> (Id.t, 'e) Core.Result.t Core.Or_error.t Async_kernel.Deferred.t
Sourceval dispatch_multi : ('q, 'r, 'e) dispatch t -> Async_rpc_kernel.Versioned_rpc.Connection_with_menu.t -> ('q, 'r, 'e) dispatch

Determine which supported dispatch strategy to use and invoke the chosen rpcs. To unsubscribe, you can use abort.

Sourceval singleton : ('q, 'r, 'e) Async_rpc_kernel.Rpc.Pipe_rpc.t -> ('q, 'r, 'e) dispatch t

Create a new caller supporting a single rpc.

Sourceval add : ('q, 'r, 'e) dispatch t -> rpc:('q, 'r, 'e) Async_rpc_kernel.Rpc.Pipe_rpc.t -> ('q, 'r, 'e) dispatch t

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

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

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

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

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

Sourceval map_error : ('q, 'r, 'e1) dispatch t -> f:('e1 -> 'e2) -> ('q, 'r, 'e2) dispatch t

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

Sourceval abort : Id.t -> unit

Given the Id.t returned from dispatch_multi, cancel the subscription.