IMQClientOptions.handleSignals property
Let this package handle SIGTERM, SIGINT, SIGHUP and SIGQUIT for the process. Set it to false when the host owns shutdown — an HTTP gateway holding clients, for one.
Signature:
handleSignals?: boolean;
Default Value
true
Remarks
Left on, the client installs handlers that destroy it — abandoning the calls still waiting for an answer — and exit the process after IMQ_SHUTDOWN_TIMEOUT, and its queue installs its own (see the core IMQOptions.handleSignals). A host's own shutdown handler cannot finish its work before that exit.
false stops both, so the host decides: stop taking new work, let the calls already made settle, then call destroy().
With draining enabled in the process (IMQ_DRAIN_ENABLE=1, or a service constructed with drain), the queue's handlers are suppressed anyway and the client's own are left for the drain to take over — unless this is false, in which case the client installs none.
Handlers are process-wide: any other client or service in the process that leaves this on still exits the process on a signal.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.