Ir al contenido
Español

ControlAwareMailboxOptionsBuilder

Esta página aún no está disponible en tu idioma.

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:109

Fluent builder for ControlAwareMailboxOptionsType:

const hubMailboxOptions = ControlAwareMailboxOptions.create<HubMessage>()
.withIsControl((message) => message.kind === 'admin')
.withCapacity(10_000)
.withOverflow('drop-head');
new ControlAwareMailbox(hubMailboxOptions);

T

new ControlAwareMailboxOptionsBuilder<T>(): ControlAwareMailboxOptionsBuilder<T>

ControlAwareMailboxOptionsBuilder<T>

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withCapacity(capacity): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:121

Maximum queued ordinary messages. Must be >= 1. Unset means unbounded.

number

this


withDeadLetterDrops(deadLetterDrops): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:136

Dead-letter each dropped envelope instead of only counting it. Default false.

boolean

this


withIsControl(isControl): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:116

Which messages overtake the ordinary ones — only an answer of true counts. Required.

(message) => boolean

this


withOnControlError(onControlError): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:141

Hook fired each time isControl throws (for diagnostics). Unset, the first throw is logged once.

(cause, message) => void

this


withOnDrop(onDrop): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:131

Hook fired on each overflow drop, with the envelope it discarded.

MailboxDropObserver<T>

this


withOverflow(overflow): this

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:126

What to do when an ordinary message arrives on a full mailbox. Default reject.

BoundedMailboxOverflow

this


static create<T>(): ControlAwareMailboxOptionsBuilder<T>

Defined in: src/mailbox/ControlAwareMailboxOptions.ts:111

Start a fresh builder. Equivalent to new ControlAwareMailboxOptionsBuilder<T>().

T

ControlAwareMailboxOptionsBuilder<T>