Commit | Line | Data |
---|---|---|
60d1f5b0 JB |
1 | import { availableParallelism } from 'poolifier'; |
2 | ||
268a74bb | 3 | export class WorkerConstants { |
59b6ed8d JB |
4 | public static readonly EMPTY_FUNCTION = Object.freeze(() => { |
5 | /* This is intentional */ | |
6 | }); | |
7 | ||
ceec2441 JB |
8 | public static readonly DEFAULT_ELEMENT_START_DELAY = 0; |
9 | public static readonly DEFAULT_WORKER_START_DELAY = 500; | |
10 | public static readonly POOL_MAX_INACTIVE_TIME = 60000; | |
cc506599 | 11 | public static readonly DEFAULT_POOL_MIN_SIZE = Math.floor(availableParallelism() / 2); |
60d1f5b0 | 12 | public static readonly DEFAULT_POOL_MAX_SIZE = availableParallelism(); |
ceec2441 | 13 | public static readonly DEFAULT_ELEMENTS_PER_WORKER = 1; |
4db8406c | 14 | |
2bb7a73e | 15 | public static readonly version = '1.0.1'; |
628c30e5 | 16 | |
4db8406c JB |
17 | private constructor() { |
18 | // This is intentional | |
19 | } | |
6f96009b | 20 | } |