Module Async_smtp.Multispool.Make.Queue_reader

Interface for iteration and waiting on queue activity. Multiple processes will not interfere with one another.

type t
val create : spool ‑> Spoolable.Queue.t ‑> t Async.Deferred.Or_error.t
val iter : ?⁠stop:unit Async.Deferred.t ‑> f:(Spoolable.Metadata.t ‑> Data_file.t ‑> [ `Save of Spoolable.Metadata.t * Spoolable.Queue.t | `Remove ] Async.Deferred.t) ‑> t ‑> unit Async.Deferred.Or_error.t

Iterate over entries in a queue and call f on each, and wait for a new entry if the list is exhausted.

val iter_available : f:(Spoolable.Metadata.t ‑> Data_file.t ‑> [ `Save of Spoolable.Metadata.t * Spoolable.Queue.t | `Remove ] Async.Deferred.t) ‑> t ‑> unit Async.Deferred.Or_error.t

Iterate over entries in a queue and call f on each, if any are available. Do not wait.