X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerConstants.ts;h=4e0bce1f86dca990f99be28649b0dafe50620488;hb=628c30e510dd0f12be4432bd5eb0ff86790c4de0;hp=72d436d439f444416524d4bc5245b26fb19ed01a;hpb=abe9e9dd3d72acc384fa2d3acd434f0053d8c61e;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerConstants.ts b/src/worker/WorkerConstants.ts index 72d436d4..4e0bce1f 100644 --- a/src/worker/WorkerConstants.ts +++ b/src/worker/WorkerConstants.ts @@ -1,14 +1,18 @@ +import { availableParallelism } from 'poolifier'; + export class WorkerConstants { public static readonly EMPTY_FUNCTION = Object.freeze(() => { /* This is intentional */ }); - static readonly DEFAULT_ELEMENT_START_DELAY = 0; - static readonly DEFAULT_WORKER_START_DELAY = 500; - static readonly POOL_MAX_INACTIVE_TIME = 60000; - static readonly DEFAULT_POOL_MIN_SIZE = 4; - static readonly DEFAULT_POOL_MAX_SIZE = 16; - static readonly DEFAULT_ELEMENTS_PER_WORKER = 1; + public static readonly DEFAULT_ELEMENT_START_DELAY = 0; + public static readonly DEFAULT_WORKER_START_DELAY = 500; + public static readonly POOL_MAX_INACTIVE_TIME = 60000; + public static readonly DEFAULT_POOL_MIN_SIZE = availableParallelism() / 2; + public static readonly DEFAULT_POOL_MAX_SIZE = availableParallelism(); + public static readonly DEFAULT_ELEMENTS_PER_WORKER = 1; + + public static readonly version = '1.0.0'; private constructor() { // This is intentional