Interface: WorkerOptions
Defined in: core/src/threads/ThreadPool.ts:26
Describes the various options that can be used when creating worker threads.
Properties
allowTs?
optionalallowTs?:boolean
Defined in: core/src/threads/ThreadPool.ts:34
Set to true to enable support for importing TypeScript modules in the worker. Default is true.
args?
optionalargs?:any
Defined in: core/src/threads/ThreadPool.ts:28
The list of initialization arguments to pass into the worker thread.
entry?
optionalentry?:string
Defined in: core/src/threads/ThreadPool.ts:30
The path to the entry file create a worker thread from. Default is ThreadWorkerEntry.js.
restartOnExit?
optionalrestartOnExit?:boolean
Defined in: core/src/threads/ThreadPool.ts:32
Indicates if a worker thread should automatically be restarted on exit.
startupTimeoutMs?
optionalstartupTimeoutMs?:number
Defined in: core/src/threads/ThreadPool.ts:43
The maximum amount of time, in milliseconds, to wait for all worker threads to report readiness before
start() rejects. Default is ThreadPool.START_TIMEOUT_MS. Guards against a worker whose entry script
hangs during its own setup and never posts online/emits an error, which would otherwise leave the
returned promise hanging forever with no way to detect or recover.
worker?
optionalworker?:string
Defined in: core/src/threads/ThreadPool.ts:36
The path to the worker file. This must be set when using ThreadWorkerEntry as the default entry file.