Module Eio_utils.Zzz
A set of timers.
module Key : sig ... endA handle to a registered timer.
val create : unit -> Eio_utils.Zzz.tcreate () is a fresh empty queue.
val add :
Eio_utils.Zzz.t ->
Mtime.t ->
Eio_utils.Zzz.item ->
Eio_utils.Zzz.Key.tadd t time item adds a new event, due at time, and returns its ID.
If item is a Fiber, you must use Eio.Private.Fiber_context.set_cancel_fn on it before calling pop. Your cancel function should call remove (in addition to resuming it).
val remove : Eio_utils.Zzz.t -> Eio_utils.Zzz.Key.t -> unitremove t key removes an event previously added with add.
val pop :
Eio_utils.Zzz.t ->
now:Mtime.t ->
[ `Due of Eio_utils.Zzz.item | `Wait_until of Mtime.t | `Nothing ]pop ~now t removes and returns the earliest item due by now. For fibers, it also clears the thread's cancel function. If no item is due yet, it returns the time the earliest item becomes due.