This module contains the implementation of Std.Notify. Std.Notify provides a lightweight
notification primitive for signaling between tasks or threads. It supports both synchronous
and asynchronous waiting, and is useful for cases where you want to notify one or more waiters
that an event has occurred.
Unlike a channel, Std.Notify does not buffer messages or carry data. It's simply a trigger.
If no one is waiting, notifications are lost. If one or more waiters are present, exactly one
will be woken up per notification.
- normal {α : Type} (promise : IO.Promise α) : Consumer α
- select {α : Type} (finished : Internal.IO.Async.Waiter α) : Consumer α
Instances For
A notify is a synchronization primitive that allows multiple consumers to wait until notify is called.
Instances For
Notify all currently waiting consumers.
Equations
Instances For
Notify exactly one waiting consumer (if any). Returns true if a consumer was notified, false if no consumers were waiting.
Equations
Instances For
Wait to be notified. Returns a task that completes when notify is called. Note: if notify was called before wait, this will wait for the next notify call.
Equations
Instances For
Creates a selector that waits for notifications