1 import { availableParallelism
} from
'poolifier';
3 export class WorkerConstants
{
4 public static readonly EMPTY_FUNCTION
= Object.freeze(() => {
5 /* This is intentional */
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;
15 public static readonly version
= '1.0.0';
17 private constructor() {
18 // This is intentional