Mailbox implementation for message passing.
A mailbox is an atom wrapping a persistent queue with watch-based notification for efficient blocking receive.
Mailbox implementation for message passing. A mailbox is an atom wrapping a persistent queue with watch-based notification for efficient blocking receive.
(mailbox-receive! mb)(mailbox-receive! mb timeout-ms timeout-val)Blocking receive from mailbox with optional timeout. Uses atom watch for efficient wake-up on message arrival.
Arities:
Blocking receive from mailbox with optional timeout. Uses atom watch for efficient wake-up on message arrival. Arities: - [mb] - block forever until message arrives - [mb timeout-ms timeout-val] - wait up to timeout-ms, return timeout-val on timeout
(mailbox-send! mb msg)Send a message to a mailbox (non-blocking).
Send a message to a mailbox (non-blocking).
(make-mailbox)Create a new empty mailbox.
Create a new empty mailbox.
(maybe-mailbox-receive! mb)Non-blocking receive from mailbox. Returns message if available, nil otherwise.
Non-blocking receive from mailbox. Returns message if available, nil otherwise.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |