package babel

  1. Overview
  2. Docs
type -'a t

Like Rpc.Pipe_rpc.Direct_stream_writer, but with the additional ability to map functions over its inputs.

Create a Babel-friendly direct stream writer from a raw Async_rpc one.

The result of map_input and filter_map_input writes to the same underlying Rpc.Pipe_rpc.Direct_stream_writer.t that the original t does.

val map_input : 'a t -> f:('b -> 'a) -> 'b t
val filter_map_input : 'a t -> f:('b -> 'a option) -> 'b t

These functions work the same way as the ones in Rpc.Pipe_rpc.Direct_stream_writer.

val write : 'a t -> 'a -> [ `Flushed of unit Async_kernel.Deferred.t | `Closed ]
val write_without_pushback : 'a t -> 'a -> [ `Ok | `Closed ]
val close : _ t -> unit
val closed : _ t -> unit Async_kernel.Deferred.t
val flushed : _ t -> unit Async_kernel.Deferred.t
val is_closed : _ t -> bool
module Expert : sig ... end
module Group : sig ... end

Like Rpc.Pipe_rpc.Direct_stream_writer.Group, but with the ability to maintain multiple subgroups. One Rpc.Pipe_rpc.Direct_stream_writer.Group is maintained per implemented RPC, so values are only converted and serialized once per RPC.

OCaml

Innovation. Community. Security.