Skip to main content
Version: 8.9

Interface: JobWorker

Accessors

activeJobs

Get Signature

get activeJobs(): number;
Returns

number


name

Get Signature

get name(): string;
Returns

string


stopped

Get Signature

get stopped(): boolean;
Returns

boolean

Methods

start()

start(): void;

Returns

void


stop()

stop(): void;

Returns

void


stopGracefully()

stopGracefully(opts?): Promise<{
remainingJobs: number;
timedOut: boolean;
}>;

Gracefully stop the worker: prevent new polls, allow any in-flight activation to finish without cancellation, and wait for currently active jobs to drain (be acknowledged) up to waitUpToMs. If timeout is reached, falls back to hard stop logic (cancels activation if still pending).

Parameters

opts?
checkIntervalMs?

number

waitUpToMs?

number

Returns

Promise<{ remainingJobs: number; timedOut: boolean; }>