package async_parallel

  1. Overview
  2. Docs

A Channel.t is a bi-directional communication channel for communicating to a Hub.t. Channels are portable across processes. A channel can be sent to another process, either explicitly or by being in a closure and it will continue to work.

type ('to_hub, 'from_hub) t
val create : ?buffer_age_limit:[ `At_most of Core.Time.Span.t | `Unlimited ] -> addr:(Async.Unix.Inet_addr.t * int) -> unit -> (_, _) t Async.Deferred.t

create is type-unsafe, and should not be used by user code.

val close : (_, _) t -> unit Async.Deferred.t
val read : (_, 'b) t -> 'b Async.Deferred.t
val read_full : (_, 'b) t -> 'b Async.Reader.Read_result.t Async.Deferred.t
val write : ('a, _) t -> 'a -> unit
type 'a pre_packed
val pre_pack : 'a -> 'a pre_packed
val write_pre_packed : ('a, _) t -> 'a pre_packed -> unit
val flushed : (_, _) t -> unit Async.Deferred.t
val socket : (_, _) t -> Async.Unix.Inet_addr.t * int
val errors : (_, _) t -> exn Async.Stream.t

Similar to Monitor.detach_and_get_error_stream, collects all writer errors. If this function has never been called, then exceptions will be raised directly

OCaml

Innovation. Community. Security.