Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/express-cluster...
[poolifier.git] / examples / typescript / websocket-server-pool / ws-worker_threads / src / main.ts
index 1eda1e92dd3b8f47ecbde99b9098768388eb92cf..0c1acba1b43bc1683261788b001c78c931c08c0c 100644 (file)
@@ -5,15 +5,15 @@ 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}/`
   )
 })
 
 const emptyFunction = (): void => {
-  /** Intentional */
+  /* 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,