@waboyz-baileys/shared
Version:
14 lines (13 loc) • 597 B
TypeScript
export type ShutdownServiceProps = {
label: string;
fn: () => Promise<any | void> | (any | void);
timeout: number;
};
/**
* Gracefully shuts down a list of async services concurrently with logging and optional timeout wrapping.
*
* @param services - An array of services with a label and shutdown function.
* @param concurrency - How many shutdowns to run in parallel (default: 1).
* @returns Resolves when all shutdown attempts complete (fulfilled or rejected).
*/
export declare function shutdownServices(services: ShutdownServiceProps[], concurrency?: number): Promise<void>;