},
...options
}
+ const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
const pool = new DynamicThreadPool<ThreadWorkerData, ThreadWorkerResponse>(
- options.minWorkers as number,
- options.maxWorkers as number,
- options.workerFile,
- options
+ minWorkers as number,
+ maxWorkers as number,
+ workerFile,
+ poolOptions
)
if (!fastify.hasDecorator('pool')) {
fastify.decorate('pool', pool)
},
...options
}
+ const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
const pool = new DynamicThreadPool<WorkerData, WorkerResponse>(
- options.minWorkers as number,
- options.maxWorkers as number,
- options.workerFile,
- options
+ minWorkers as number,
+ maxWorkers as number,
+ workerFile,
+ poolOptions
)
if (!fastify.hasDecorator('pool')) {
fastify.decorate('pool', pool)
workerData?: WorkerData
): WorkerResponse => {
const { port } = workerData as WorkerData
+
WebSocketServerWorker.wss = new WebSocketServer({ port }, () => {
console.info(
`⚡️[ws server]: WebSocket server is started in cluster worker at ws://localhost:${port}/`