Arcana::Mailbox
A buffered inbox for a single agent address.
Backed by a Deque (not a Channel) so messages can be inspected without consuming them and selectively received by id.
Optionally bounded: pass max_queue: to reject deliveries with
MailboxFull when the queue reaches capacity. Unbounded by
default — the daemon sets a global default via ARCANA_MAILBOX_MAX_QUEUE.
Constructors
Instance methods
Block until all expectations are met or timeout expires. Returns true if all met, false on timeout.
Deliver an envelope to this mailbox. Raises MailboxFull when
max_queue is set and the queue is at capacity.
Optional event recorder. Bus sets this on newly created mailboxes so deliver/consume/freeze/thaw emit audit events.
Optional event recorder. Bus sets this on newly created mailboxes so deliver/consume/freeze/thaw emit audit events.
Freeze a message: move from deque to frozen map. Returns true if a message was frozen.
Mark an expectation as fulfilled. Called automatically by deliver.
Restore mailbox state from a snapshot. Replaces existing state.
Optional callback invoked on any activity (deliver, receive). Used by Bus to refresh Directory last_seen.
Optional callback invoked on any activity (deliver, receive). Used by Bus to refresh Directory last_seen.
Block until a specific message (by correlation_id) arrives or timeout expires. Returns nil on timeout.
Block until an envelope arrives or timeout expires. Returns nil on timeout.
Receive a specific message by correlation_id. Returns nil if not found.
Thaw a frozen message: move back to deque. Returns the thawed envelope, or nil if not found.