Zum Inhalt springen
Deutsch

PriorityMailbox

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

Defined in: src/mailbox/PriorityMailbox.ts:17

User messages are dequeued in priority order (ascending priority value, then FIFO). System messages still take strict precedence over any user message. Internally backed by an ordered array — suitable for moderate mailbox sizes; swap for a heap if throughput becomes a concern.

T = unknown

new PriorityMailbox<T>(options): PriorityMailbox<T>

Defined in: src/mailbox/PriorityMailbox.ts:23

PriorityMailboxOptions<T>

PriorityMailbox<T>

Mailbox.constructor

get size(): number

Defined in: src/mailbox/PriorityMailbox.ts:51

Number of pending user messages.

number

Mailbox.size


get suspended(): boolean

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

boolean

Mailbox.suspended

dequeueSystem(): Envelope<unknown> | undefined

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

Envelope<unknown> | undefined

Mailbox.dequeueSystem


dequeueUser(): Envelope<T> | undefined

Defined in: src/mailbox/PriorityMailbox.ts:46

Envelope<T> | undefined

Mailbox.dequeueUser


drainSystem(): Envelope<unknown>[]

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

Envelope<unknown>[]

Mailbox.drainSystem


drainUser(): Envelope<T>[]

Defined in: src/mailbox/PriorityMailbox.ts:55

Drain all user messages; returns them so the caller can forward to dead letters.

Envelope<T>[]

Mailbox.drainUser


enqueue(env): void

Defined in: src/mailbox/PriorityMailbox.ts:28

Envelope<T>

void

Mailbox.enqueue


enqueueSystem(env): void

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

Envelope<unknown>

void

Mailbox.enqueueSystem


hasMessages(): boolean

Defined in: src/mailbox/PriorityMailbox.ts:68

Peek at the next message that would be dequeued, without removing it.

boolean

Mailbox.hasMessages


hasSystemMessages(): boolean

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

boolean

Mailbox.hasSystemMessages


hasUserMessages(): boolean

Defined in: src/mailbox/PriorityMailbox.ts:53

boolean

Mailbox.hasUserMessages


prependUser(envs): void

Defined in: src/mailbox/PriorityMailbox.ts:61

Put envelopes at the FRONT of the user queue, preserving their order.

Envelope<T>[]

void

Mailbox.prependUser


resume(): void

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

void

Mailbox.resume


suspend(): void

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

void

Mailbox.suspend