For the complete documentation index, see llms.txt.
Skip to main content
Version: 8.10

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;

Begin polling for jobs. Safe to call at any point: the request is buffered until the transport is ready, and redundant calls (including an explicit call on an autoStart worker) are dropped rather than starting a second poll loop. Once the worker is stopped, start() is a no-op.

Returns​

void


stop()​

stop(): void;

Returns​

void


stopGracefully()​

stopGracefully(opts?): Promise<GracefulStopResult>;

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<GracefulStopResult>