IMQMode enum

Operating mode of a queue instance, selecting which halves of the queue are active. Passed as the third constructor argument and defaults to IMQMode.BOTH.

All modes still open a writer connection and take part in watcher election; the mode only controls whether a reader is created and whether sending is allowed.

Signature:

export declare enum IMQMode 

Enumeration Members

Member

Value

Description

BOTH

0

Consume and produce. This is the default.

PUBLISHER

2

Produce only. No reader connection is opened, so the queue never emits message events and never releases delayed messages.

WORKER

1

Consume only. No messages can be sent — send() throws a TypeError.

Remarks

The members carry implicit numeric values and BOTH is 0, so a falsy check such as mode || IMQMode.WORKER silently resolves to WORKER. Do not persist these values either — they shift if the members are reordered.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.