publishing from another file #773
Replies: 3 comments
-
Node can open multiple script files with |
Beta Was this translation helpful? Give feedback.
-
If you are talking about 2 different Node processes you need Inter Process Communication with Net module https://nodejs.org/api/net.html#net Or use Child Process https://nodejs.org/api/child_process.html |
Beta Was this translation helpful? Give feedback.
-
@e3dio Thanks for the response. I will look into net module. I was also going through https://github.com/tardis-dev/serum-vial project and here they are using worker and broadcast channel for communication. Here is how i resolve
and the abc.js
|
Beta Was this translation helpful? Give feedback.
-
I am running websocket server in app.js but for some reason I need the access to the app instance in another file to publish messages.
Is this possible?
So basically app.js run the websocket server and script.js is running a script and it generates some data every x seconds and I want to publish the outputs of this script to the connected clients in app.js.
Beta Was this translation helpful? Give feedback.
All reactions