X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fwebsocket-server-pool%2Fws-hybrid%2Fsrc%2Fmain.ts;h=177d7d3b5813f04ff10dd8812f8eafeec1099407;hb=c5033c2df4fef157ccba4adaada5794b32e83f7f;hp=f6536bd0bbc3bbde78e8cd5bf68cfb48099e1fc6;hpb=fef029a52aacd3063ba882834ce58527600009ca;p=poolifier.git diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts index f6536bd0..177d7d3b 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts @@ -1,7 +1,7 @@ import { dirname, extname, join } from 'node:path' import { fileURLToPath } from 'node:url' import { FixedClusterPool, availableParallelism } from 'poolifier' -import { type ClusterWorkerData, type ClusterWorkerResponse } from './types.js' +import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js' const webSocketServerWorkerFile = join( dirname(fileURLToPath(import.meta.url)), @@ -17,6 +17,7 @@ const pool = new FixedClusterPool( Math.round(availableParallelism() / 2), webSocketServerWorkerFile, { + enableEvents: false, onlineHandler: () => { pool .execute({ @@ -41,7 +42,7 @@ const pool = new FixedClusterPool( `WebSocket server is listening in cluster worker on port ${response.port}` ) } - return null + return undefined }) .catch(error => { console.error(