Rulvar API reference / @rulvar/cli / CreateWorkerOptions
Interface: CreateWorkerOptions
Defined in: packages/cli/src/worker.ts:59
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
argsFor? | (meta) => unknown | The OQ-21 interim channel: original in-process run arguments are not journaled in v1, so the host re-supplies them per run. Absent means args resume as undefined (fully replayed prefixes never notice). | packages/cli/src/worker.ts:95 |
concurrency? | number | Appendix A: leased runs per worker process; default 1. | packages/cli/src/worker.ts:67 |
extraDerivers? | KeyDeriver[] | DEF-6 window extension, in lockstep with the engine assembly. | packages/cli/src/worker.ts:97 |
onError? | (runId, error) => void | Observability hook for per-run failures; never throws into the loop. | packages/cli/src/worker.ts:99 |
owner? | string | Lease owner id; defaults to a per-process identity. | packages/cli/src/worker.ts:69 |
pollMs? | number | Idle sweep cadence for start(); default 1000 ms. An integer between 1 and 2147483647 ms, refused as a ConfigError at construction (an overflow or a value that is not finite would collapse to the 1 ms floor and storm the store; v1.35.0 review P2-4). Zero is not a manual mode: drive sweeps directly with worker.sweep() instead of start(). | packages/cli/src/worker.ts:89 |
retention? | (meta) => boolean | Opt-in retention (OQ-20 executed at M8-T04): evaluated during sweeps over SETTLED runs (terminal meta); a true verdict applies engine.deleteRun under a briefly held lease. Absent means everything persists indefinitely. | packages/cli/src/worker.ts:106 |
store | LeasableStore | The LeasableStore to lease runs from; MUST be the same journal the engine writes (Engine.stores.journal), or the fencing epoch would protect a store nobody appends to. Verified at start. | packages/cli/src/worker.ts:65 |
ttlMs? | number | The store's lease ttl; the worker renews at ttl/3 (the normative bound). An integer between 1 and 2147483647 ms, refused as a ConfigError at construction. MUST match the store's configured ttl: when the store exposes the optional leaseTtlMs capability (SqliteStore does), the match is VERIFIED at construction and a mismatch is a ConfigError; a store without the capability is trusted. Omitted, the worker ADOPTS the store's exposed ttl, falling back to the Appendix A reference 60000 ms. | packages/cli/src/worker.ts:80 |