PriorityMailboxOptionsBuilder
이 콘텐츠는 아직 번역되지 않았습니다.
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);Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PriorityMailboxOptionsBuilder<
T>():PriorityMailboxOptionsBuilder<T>
Returns
Section titled “Returns”PriorityMailboxOptionsBuilder<T>
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withCapacity()
Section titled “withCapacity()”withCapacity(
capacity):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:123
Maximum queued user messages. Must be >= 1. Unset means unbounded.
Parameters
Section titled “Parameters”capacity
Section titled “capacity”number
Returns
Section titled “Returns”this
withDeadLetterDrops()
Section titled “withDeadLetterDrops()”withDeadLetterDrops(
deadLetterDrops):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:138
Dead-letter each dropped envelope instead of only counting it. Default false.
Parameters
Section titled “Parameters”deadLetterDrops
Section titled “deadLetterDrops”boolean
Returns
Section titled “Returns”this
withOnDrop()
Section titled “withOnDrop()”withOnDrop(
onDrop):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:133
Hook fired on each overflow drop, with the envelope it discarded.
Parameters
Section titled “Parameters”onDrop
Section titled “onDrop”Returns
Section titled “Returns”this
withOnPriorityError()
Section titled “withOnPriorityError()”withOnPriorityError(
onPriorityError):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:143
Hook fired when priorityFor could not rank a message (for diagnostics).
Parameters
Section titled “Parameters”onPriorityError
Section titled “onPriorityError”(cause, message) => void
Returns
Section titled “Returns”this
withOverflow()
Section titled “withOverflow()”withOverflow(
overflow):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:128
What to do when a message arrives on a full mailbox. Default reject.
Parameters
Section titled “Parameters”overflow
Section titled “overflow”Returns
Section titled “Returns”this
withPriorityFor()
Section titled “withPriorityFor()”withPriorityFor(
priorityFor):this
Defined in: src/mailbox/PriorityMailboxOptions.ts:118
Priority function: lower numbers are dequeued first (0 = highest). Required.
Parameters
Section titled “Parameters”priorityFor
Section titled “priorityFor”Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate<T>():PriorityMailboxOptionsBuilder<T>
Defined in: src/mailbox/PriorityMailboxOptions.ts:113
Start a fresh builder. Equivalent to new PriorityMailboxOptionsBuilder<T>().
Type Parameters
Section titled “Type Parameters”T
Returns
Section titled “Returns”PriorityMailboxOptionsBuilder<T>
