X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerFactory.ts;h=a6679cca73149c07fb6130feb6eb4f8bc62dfd80;hb=23253fafe91c72ed88b47d7acfde190c22e18d28;hp=b297f42b231715643ef14761ca1c45a93295a5cf;hpb=35639ced7a1a8e9cfb7b0db675fc2757ea902d04;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index b297f42b..a6679cca 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -1,7 +1,8 @@ import { Worker, isMainThread } from 'worker_threads'; -import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker'; -import { PoolOptions } from 'poolifier'; +import type { PoolOptions } from 'poolifier'; + +import { WorkerData, WorkerOptions, WorkerProcessType } from '../types/Worker'; import type WorkerAbstract from './WorkerAbstract'; import WorkerConstants from './WorkerConstants'; import WorkerDynamicPool from './WorkerDynamicPool'; @@ -19,7 +20,7 @@ export default class WorkerFactory { workerOptions?: WorkerOptions ): WorkerAbstract | null { if (!isMainThread) { - throw new Error('Trying to get a worker implementation outside the main thread'); + throw new Error('Cannot get a worker implementation outside the main thread'); } workerOptions = workerOptions ?? ({} as WorkerOptions); workerOptions.workerStartDelay =