Module Awaitable.Awaiter

Low level interface for more flexible waiting.

type 'a awaitable := 'a t

An erased type alias for Awaitable.t.

type t

Represents a single use awaiter of a signal to an awaitable.

val add : 'a awaitable -> Picos.Trigger.t -> t

add awaitable trigger creates a single use awaiter, adds it to the FIFO associated with the awaitable, and returns the awaiter.

val remove : t -> unit

remove awaiter marks the awaiter as having been signaled and removes it from the FIFO associated with the awaitable.

ℹ️ If the associated trigger is used with only one awaiter and the Trigger.awaitawait on the trigger returns None, there is no need to explicitly remove the awaiter, because it has already been removed.