Module Async_extra.Rpc_transport_low_latency.Reader

module type S = Async_rpc_kernel.Transport_intf.Reader
include S
type t
include sig ... end
val sexp_of_t : t ‑> Sexplib.Sexp.t
val close : t ‑> unit Async_kernel.Deferred.t
val is_closed : t ‑> bool
val read_forever : t ‑> on_message:(Core_kernel.Bigstring.t ‑> pos:int ‑> len:int ‑> 'a Async_rpc_kernel.Transport_intf.Handler_result.t) ‑> on_end_of_batch:(unit ‑> unit) ‑> ('a, [ `Eof | `Closed ]) Core_kernel.Result.t Async_kernel.Deferred.t

Start reading incoming messages and pass them to on_message, until it returns Stop _.

on_end_of_batch is called after processing a batch of messages, before waiting for the file descriptor to become readable again.

val pack : (module S with type t = 'a) ‑> 'a ‑> t
val read_one_message_bin_prot : t ‑> 'a Bin_prot.Type_class.reader ‑> ('a, [ `Closed | `Eof ]) Core_kernel.Result.t Async_kernel.Deferred.t

Convenience function to wait for the first message and un-bin_prot it.

Async RPC uses this to handle the handshake at the beginning of the message stream.