-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi, I am trying to implement multithreading in a websocket with the ws protocol, in the readme example you use espress, could a TCP socket server be used?
Ejmplo:
import { WebSocketServer } from "ws";
import { PipelineManager } from "./controllers/PipelineManager";
import NodeMultithreading from 'node-multithreading';
const app = () => {
const wss = new WebSocketServer({ port: 9501 });
const logManager = (msg: string) => console.log(msg);
wss.on("listening", (e: any) => logManager("here you write the log when the service starts"));
wss.on("connection", (ws) => ws.on("message", (message: any) => PipelineManager.likes(message, ws)));
return wss;
}
NodeMultithreading(app, { isClusterActive: true, log: true, masterPort: 5000 });
Thanks for your time.
Metadata
Metadata
Assignees
Labels
No labels