Перейти к содержимому
Русский

DropReportingMailbox

Это содержимое пока не доступно на вашем языке.

Defined in: src/internal/Mailbox.ts:64

A mailbox that discards messages and is willing to say so.

Implement it on a Mailbox subclass of your own and the cell counts its drops in actor_mailbox_dropped_total, with the same {class, path, reason} labels the built-in bound produces. BoundedMailbox implements it; nothing else needs to.

The cell probes for this method rather than testing instanceof BoundedMailbox on purpose. Since #661 the base Mailbox is public and subclassing it is a supported thing to do, so a queue that drops for its own reasons should not be second-class in the telemetry.

observeDrops(observer): void

Defined in: src/internal/Mailbox.ts:74

Register a drop observer. Called by the cell once, before the mailbox receives anything.

Additive, not a setter. Whatever the mailbox already reports — BoundedMailboxOptions.onDrop, a previously registered observer — has to keep firing. A caller who wired their own metric does not lose it because the framework wired the stock one.

(reason) => void

void