import { Logger } from 'typescript-log'; export interface Options { /** Number of workers (default cpu count), if 0, starts in process. Defaults to # of cpu cores */ workers: number; /** ms to keep cluster alive (until-killed) */ lifetime: number | 'until-killed'; /** ms grace period after worker SIGTERM (default 5000) */ grace: number; /** Logger */ logger?: Logger; /** Return a promise if there is startup work before workers are started */ master?: () => Promise | void; /** * Return a promise if there is startup work before worker is considered started * * @argument masterArgs if master returns a promise this will be the resolved value */ start?: (args: { id: string; masterArgs: MasterArgs | undefined; }) => Promise | void; dedicatedWorkers?: { [name: string]: (args: { id: string; masterArgs: MasterArgs | undefined; }) => Promise | void; }; /** ms to wait for master to become available to supply masterArgs (default 5000) */ masterArgsWait?: number; } /** * Resolves when the current start function (master or start depending on context) has * finished initialising. * @param startOrOptions */ export declare function gru(startOrOptions: (Partial> & { start: Options['start']; }) | (() => void)): Promise;