include sig ... endval sexp_of_t : ('a ‑> Base.Sexp.t) ‑> 'a t ‑> Base.Sexp.tmodule Filter : sig ... endval create : ?to_sexp:('a ‑> Async.Sexp.t) ‑> (unit ‑> 'a option Async.Deferred.t) ‑> 'a tval of_stream : ?to_sexp:('a ‑> Async.Sexp.t) ‑> 'a Async.Stream.t ‑> 'a tval of_pipe : ?to_sexp:('a ‑> Async.Sexp.t) ‑> 'a Async.Pipe.Reader.t ‑> 'a tval receive : ?debug:string ‑> ?timeout:unit Async.Deferred.t ‑> ?swallow:bool ‑> 'a t ‑> filter:('a, 'b) Filter.t ‑> postcond:('b list ‑> bool) ‑> 'b list Async.Deferred.treceive t ~filter ~postcond apply postcond to the messages picked by filter.
Return if postcond returns true, otherwise keep trying until timeout becomes
determined, which will raise an exception.
If this returns successfully, the remaining data in the mailbox will be:
swallow is false.swallow is true OR if no messages passed the filter.val one : ?debug:string ‑> ?timeout:unit Async.Deferred.t ‑> ?swallow:bool ‑> 'a t ‑> ('a, 'b) Filter.t ‑> 'b Async.Deferred.tone t f run receive, asserting that there is exactly one matching message.
val two : ?debug:string ‑> ?timeout:unit Async.Deferred.t ‑> ?swallow:bool ‑> 'a t ‑> ('a, 'b) Filter.t ‑> ('b * 'b) Async.Deferred.ttwo t f run receive, asserting that there are exactly two matching messages.
val many : ?debug:string ‑> ?timeout:unit Async.Deferred.t ‑> ?swallow:bool ‑> 'a t ‑> int ‑> ('a, 'b) Filter.t ‑> 'b list Async.Deferred.tmany t n f run receive, asserting that there are exactly n matching messages.
val not_empty : ?debug:string ‑> ?timeout:unit Async.Deferred.t ‑> 'a t ‑> ('a, 'b) Filter.t ‑> 'b list Async.Deferred.tnot_empty t f run receive, asserting that there is at least one matching message.
val clear : ?to_remove:('a ‑> bool) ‑> 'a t ‑> unitclear t wipes out all previously received messages matching the to_remove
predicate. If to_remove is not provided, wipes out all the messages.
Immediately after calling clear t, zero t f succeeds for any f.
val check_clear : _ t ‑> unit Core.Or_error.tcheck_clear t - Ok if the mailbox is empty, descriptive error if the mailbox
has any messages