IMQService.(constructor)

Constructs a service.

Signature:

constructor(options?: Partial<IMQServiceOptions>, name?: string);

Parameters

Parameter

Type

Description

options

Partial<IMQServiceOptions>

(Optional) service options, shallow-merged over DEFAULT_IMQ_SERVICE_OPTIONS, except metricsServer which is merged separately over DEFAULT_IMQ_METRICS_SERVER_OPTIONS

name

string

(Optional) overrides the class name as the service/queue name, and as the description cache key

Exceptions

TypeError when IMQService is instantiated directly. Note the check is by resolved name, so passing 'IMQService' as the name of a subclass throws as well.

Remarks

Constructing a service installs process signal handlers for SIGTERM, SIGINT, SIGHUP and SIGQUIT. On any of them the service tears the queue down, closes the metrics server, and then force-exits with code 0 after IMQ_SHUTDOWN_TIMEOUT — a fixed timer, not a drain: requests still being processed are not awaited.

The merged options are passed straight to the queue factory, so vendor and cluster/clusterManagers select the transport implementation.

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