Broadcast Channel: optimize requests handling implementation
[e-mobility-charging-stations-simulator.git] / src / worker / WorkerUtils.ts
CommitLineData
51c83d6f
JB
1import { threadId } from 'worker_threads';
2
8eac9a09
JB
3import chalk from 'chalk';
4
7874b0b1 5export class WorkerUtils {
d5bd1c00
JB
6 private constructor() {
7 // This is intentional
8 }
9
7874b0b1
JB
10 public static defaultExitHandler = (code: number): void => {
11 if (code !== 0) {
51c83d6f 12 console.error(chalk.red(`Worker ${threadId} stopped with exit code ${code}`));
7874b0b1
JB
13 }
14 };
15}