Rulvar API reference / @rulvar/cli / Worker
Interface: Worker
Defined in: packages/cli/src/worker.ts:262
Methods
active()
active(): string[];Defined in: packages/cli/src/worker.ts:282
runIds occupying a slot: runs held under a lease, plus evicted runs (a failed renew) still unwinding their cancel. A slot frees only when its run settles, never before the cancel lands (RV4913).
Returns
string[]
lastSweepError()
lastSweepError(): unknown;Defined in: packages/cli/src/worker.ts:289
Readiness (RV4913): the error of the most recent sweep that failed against the store, or undefined once a later sweep completed. A store outage used to be a silent idle; with this flag a health probe can report a worker that polls a store it cannot read.
Returns
unknown
start()
start(): void;Defined in: packages/cli/src/worker.ts:264
Begins sweeping on the poll cadence. Idempotent.
Returns
void
stop()
stop(): Promise<void>;Defined in: packages/cli/src/worker.ts:276
Stops sweeping, cancels in flight runs (evicted runs included) and waits for their settle, releases held leases.
Returns
Promise<void>
sweep()
sweep(): Promise<number>;Defined in: packages/cli/src/worker.ts:271
One sweep: lease and resume eligible runs up to the concurrency cap. Returns the number of runs picked up. Exposed so hosts and tests can drive the worker deterministically without timers. A store failure rejects here and raises lastSweepError().
Returns
Promise<number>