X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fwebsocket-server-pool%2Fws-worker_threads%2Fsrc%2Fmain.ts;h=9edb16b03a399768725b2b904f8186183136574e;hb=8ebe6c308dc1fc3202980126da043b2855d24780;hp=1eda1e92dd3b8f47ecbde99b9098768388eb92cf;hpb=d2bc8d8026164b1389822feced0f42af20552176;p=poolifier.git diff --git a/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts b/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts index 1eda1e92..9edb16b0 100644 --- a/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts @@ -5,7 +5,7 @@ import { requestHandlerPool } from './pool.js' const port = 8080 const wss = new WebSocketServer({ port }, () => { console.info( - `⚡️[ws server]: WebSocket server is started at http://localhost:${port}/` + `⚡️[ws server]: WebSocket server is started at ws://localhost:${port}/` ) }) @@ -13,7 +13,7 @@ const emptyFunction = (): void => { /** Intentional */ } -wss.on('connection', ws => { +wss.on('connection', (ws) => { ws.on('error', console.error) ws.on('message', (message: RawData) => { const { type, data } = JSON.parse( @@ -24,7 +24,7 @@ wss.on('connection', ws => { case MessageType.echo: requestHandlerPool .execute({ data }, 'echo') - .then(response => { + .then((response) => { ws.send( JSON.stringify({ type: MessageType.echo, @@ -38,7 +38,7 @@ wss.on('connection', ws => { case MessageType.factorial: requestHandlerPool .execute({ data }, 'factorial') - .then(response => { + .then((response) => { ws.send( JSON.stringify({ type: MessageType.factorial,