API Reference — Mailbox — control
New to the concept? See Building Blocks — Mailbox first.
wakeUpAll
- Wakes every receiver currently blocked in
receive()— no item is sent, nothing is queued. - Blocked receivers return
error.Wakeup. - Future receivers (those that call
receive()afterwakeUpAll()returns) are not affected. -
Distinct from
close(): the mailbox is not torn down, and the effect does not persist for receivers that start later. -
Assert:
mailbox.is_it_you(mbh.*.tag)
close
- Can be called more than once.
- Returns remaining handles as list (empty list on second call).
- Collects all handles still in the queue.
- Wakes up any receivers waiting on the mailbox.
- Assert:
mailbox.is_it_you(mbh.*.tag)
destroy
- Frees the mailbox.
- Must be closed first.
- Calling destroy on an open mailbox is a programming error (panic).
- Assert:
mailbox.is_it_you(mbh.*.tag)
is_it_you
- Returns true if tag identifies a MailboxHandle.
Next: Error sets.