Strict_pipe.Reader
val read : 't t -> [ `Eof | `Ok of 't ] Async_kernel.Deferred.t
Read a single value from the pipe or fail if the pipe is closed
val read' : 't t -> [ `Eof | `Ok of 't Base.Queue.t ] Async_kernel.Deferred.t
val to_linear_pipe : 't t -> 't Linear_pipe.Reader.t
val of_linear_pipe : ?name:string -> 't Linear_pipe.Reader.t -> 't t
val pipe_name : _ t -> string option
val fold :
'a t ->
init:'b ->
f:( 'b -> 'a -> 'b Async_kernel.Deferred.t ) ->
'b Async_kernel.Deferred.t
This is equivalent to CSP style communication pattern. This does not * delegate to Pipe.iter
under the hood because that emulates a * "single-threadedness" with its pushback mechanism. We want more of a CSP * model.
val fold_until :
'a t ->
init:'b ->
f:( 'b -> 'a -> [ `Continue of 'b | `Stop of 'c ] Async_kernel.Deferred.t ) ->
[ `Eof of 'b | `Terminated of 'c ] Async_kernel.Deferred.t
Like `fold`, except that `f` can terminate the fold early
val fold_without_pushback :
?consumer:Async_kernel.Pipe.Consumer.t ->
'a t ->
init:'b ->
f:( 'b -> 'a -> 'b ) ->
'b Async_kernel.Deferred.t
This has similar semantics to fold reader ~init ~f
, but f isn't * deferred. This function delegates to Pipe.fold_without_pushback
val iter :
'a t ->
f:( 'a -> unit Async_kernel.Deferred.t ) ->
unit Async_kernel.Deferred.t
This is a specialization of a fold for the common case of accumulating * unit. See fold reader ~init ~f
val iter' :
'a t ->
f:( 'a Base.Queue.t -> unit Async_kernel.Deferred.t ) ->
unit Async_kernel.Deferred.t
val iter_without_pushback :
?consumer:Async_kernel.Pipe.Consumer.t ->
?continue_on_error:bool ->
'a t ->
f:( 'a -> unit ) ->
unit Async_kernel.Deferred.t
See fold_without_pushback reader ~init ~f
val clear : _ t -> unit
module Merge : sig ... end
module Fork : sig ... end
A synchronous write on a pipe that is later forked resolves its deferred * when all readers take the message (assuming the readers obey the CSP-style * iter