*/
constructor(workerScript: string, workerOptions?: WorkerOptions) {
super(workerScript, workerOptions);
- this.workerOptions.poolOptions.exitHandler = workerOptions?.poolOptions?.exitHandler ?? WorkerUtils.defaultExitHandler;
+ this.workerOptions.poolOptions.exitHandler = this.workerOptions?.poolOptions?.exitHandler ?? WorkerUtils.defaultExitHandler;
this.pool = new DynamicThreadPool<WorkerData>(this.workerOptions.poolMinSize, this.workerOptions.poolMaxSize, this.workerScript, this.workerOptions.poolOptions);
}
*/
constructor(workerScript: string, workerOptions?: WorkerOptions) {
super(workerScript, workerOptions);
- this.messageHandler = workerOptions?.messageHandler ?? (() => { /* This is intentional */ });
this.workerSet = new Set<WorkerSetElement>();
+ this.messageHandler = workerOptions?.messageHandler ?? (() => { /* This is intentional */ });
}
get size(): number {
*/
constructor(workerScript: string, workerOptions?: WorkerOptions) {
super(workerScript, workerOptions);
- this.workerOptions.poolOptions.exitHandler = workerOptions?.poolOptions?.exitHandler ?? WorkerUtils.defaultExitHandler;
+ this.workerOptions.poolOptions.exitHandler = this.workerOptions?.poolOptions?.exitHandler ?? WorkerUtils.defaultExitHandler;
this.pool = new FixedThreadPool(this.workerOptions.poolMaxSize, this.workerScript, this.workerOptions.poolOptions);
}