Skip to content

Function: gracefulShutdown()

ts
function gracefulShutdown(components): GracefulShutdownHandle;

Defined in: glide-mq/src/graceful-shutdown.ts:21

Register SIGTERM and SIGINT handlers that gracefully close all provided components. Returns a Promise that resolves when all components have been closed.

Usage: const shutdown = gracefulShutdown([queue, worker, queueEvents]); // ... later, on signal or manually: await shutdown;

Parameters

ParameterType
componentsCloseable[]

Returns

GracefulShutdownHandle

Released under the Apache-2.0 License.