Zum Inhalt springen
Deutsch

PriorityMailboxOptionsBuilder

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

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

Fluent builder for PriorityMailboxOptionsType:

const triageOptions = PriorityMailboxOptions.create<Command>()
.withPriorityFor((m) => m.urgent ? 0 : 10)
.withCapacity(10_000)
.withOverflow('drop-lowest-priority');
new PriorityMailbox(triageOptions);

T

new PriorityMailboxOptionsBuilder<T>(): PriorityMailboxOptionsBuilder<T>

PriorityMailboxOptionsBuilder<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/PriorityMailboxOptions.ts:123

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

number

this


withDeadLetterDrops(deadLetterDrops): this

Defined in: src/mailbox/PriorityMailboxOptions.ts:138

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

boolean

this


withOnDrop(onDrop): this

Defined in: src/mailbox/PriorityMailboxOptions.ts:133

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

MailboxDropObserver<T>

this


withOnPriorityError(onPriorityError): this

Defined in: src/mailbox/PriorityMailboxOptions.ts:143

Hook fired when priorityFor could not rank a message (for diagnostics).

(cause, message) => void

this


withOverflow(overflow): this

Defined in: src/mailbox/PriorityMailboxOptions.ts:128

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

PriorityMailboxOverflow

this


withPriorityFor(priorityFor): this

Defined in: src/mailbox/PriorityMailboxOptions.ts:118

Priority function: lower numbers are dequeued first (0 = highest). Required.

PriorityFunction<T>

this


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

Defined in: src/mailbox/PriorityMailboxOptions.ts:113

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

T

PriorityMailboxOptionsBuilder<T>