interface WorkerOptions<TDefs, TDriver>Worker options for spawning
Properties
{ attempts: number; delay: number | (attempt: number) => number; maxDelay: number }
Connection options (child_process driver only).
boolean
boolean
Worker lifecycle options
TDriver
Driver to use for spawning the worker. If not provided, the child_process driver is dynamically loaded. Pass a driver instance for explicit control over the communication backend.
Partial<DriverOptionsFor<TDriver>>
Driver-specific options. These options are passed directly to the driver's spawn method. Available options depend on the driver being used.
Record<string, string>
Environment variables to pass to worker
string
Path to worker script
string
Advanced options
SpawnOptions
number | Partial<Record<BuiltInTimeoutKey | keyof TDefs, number>>
Timeout configuration for worker operations. Can be a number (applies to all operations) or an object with per-operation timeouts: - `WORKER_STARTUP`: Time to wait for worker to start (default: 10s) - `WORKER_MESSAGE`: Default timeout for all messages (default: 5min) - `[messageType]`: Timeout for specific message type (overrides WORKER_MESSAGE)
TransactionIdGenerator<TDefs>