| 1 | import { availableParallelism } from 'poolifier'; |
| 2 | |
| 3 | export class WorkerConstants { |
| 4 | public static readonly EMPTY_FUNCTION = Object.freeze(() => { |
| 5 | /* This is intentional */ |
| 6 | }); |
| 7 | |
| 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; |
| 11 | public static readonly DEFAULT_POOL_MIN_SIZE = Math.floor(availableParallelism() / 2); |
| 12 | public static readonly DEFAULT_POOL_MAX_SIZE = availableParallelism(); |
| 13 | public static readonly DEFAULT_ELEMENTS_PER_WORKER = 1; |
| 14 | |
| 15 | public static readonly version = '1.0.1'; |
| 16 | |
| 17 | private constructor() { |
| 18 | // This is intentional |
| 19 | } |
| 20 | } |