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