BoundedMailboxOptionsType
BoundedMailboxOptionsType =
object
Defined in: src/mailbox/BoundedMailboxOptions.ts:14
Plain options-object shape accepted by a BoundedMailbox.
Properties
Section titled “Properties”capacity
Section titled “capacity”
readonlycapacity:number
Defined in: src/mailbox/BoundedMailboxOptions.ts:15
deadLetterDrops?
Section titled “deadLetterDrops?”
readonlyoptionaldeadLetterDrops?:boolean
Defined in: src/mailbox/BoundedMailboxOptions.ts:56
Route every dropped envelope to system.deadLetters, so an overflow
leaves a forensic record and not only a counter (#773). Default false.
Opt-in rather than always-on because the cost lands in the worst
possible place: the drop happens on the sender’s stack, and
DeadLetterRef.tell runs the durable capture sink and then publishes
synchronously to every event-stream subscriber. A bound exists to
absorb a burst cheaply; turning each shed message into a fan-out
undoes that. Turn it on for the actors whose losses you would have to
explain afterwards — a command stream, a delivery confirmation — and
leave it off for the telemetry firehose the bound was drawn for.
What the dead letter carries is the message, its sender, this actor as
the recipient — and, unlike every other loss path in the framework, the
envelope’s MDC context and tracing trace as
DeadLetter.attribution. This is the one loss path that still
holds a whole envelope at the moment it gives up on it, which is why the
event was widened here: it is the only one that can say which request
lost the message rather than only that one was lost. Everywhere else the
letter is built from a bare message and a sender, and an empty
attribution there is the truth rather than an omission. See
DropReportingMailbox.deadLetterDrops.
onDrop?
Section titled “onDrop?”
readonlyoptionalonDrop?:MailboxDropObserver
Defined in: src/mailbox/BoundedMailboxOptions.ts:31
Optional hook fired each time a message is dropped by the overflow
policy. Receives the policy that triggered the drop so the consumer
can label metrics, and the envelope that was discarded (#773) — which
under drop-head is the message evicted to make room, not the arrival.
Yours alone: the cell reports to actor_mailbox_dropped_total through
DropReportingMailbox.observeDrops, which runs alongside this
rather than replacing it.
Runs on the sender’s stack, with nothing between it and the tell —
so record and return. A hook that throws puts the throw into a sender
that has no idea the receiver was bounded.
overflow?
Section titled “overflow?”
readonlyoptionaloverflow?:BoundedMailboxOverflow
Defined in: src/mailbox/BoundedMailboxOptions.ts:16
