0

I'm looking for something to make my 2 running apps to communicate with each other. I have two apps - main.js and events.js and I want to send event from events.js to main.js. I don't even know what to google for that coz everything I can find seems a little bit outdated and I'm looking something different then redis. I found out I can use uuid to communicate between different node.js processes but I don't know how. Any information would be great!

Sandra
  • 315
  • 3
  • 16
  • Possible duplicate of [Communicating between two different processes in Node.js](http://stackoverflow.com/questions/10213501/communicating-between-two-different-processes-in-node-js) – Bob_Gneu Nov 24 '16 at 00:53

2 Answers2

0

Your best bet is to use a message queue system similar to Kue.

This way you will be able to make your apps communicate to each other even if they are on different servers.

drinchev
  • 19,201
  • 4
  • 67
  • 93
0

If you want to work without the redis backend you can skip the filesystem entirely and move to Sockets/TCP communication, which is one of the ways of getting around semaphores. This is a common method of low latency communication used by applications on the same machine or across the network. I have seen and used this method in games as well as desktop/server applications.

Depending on how far down the rabbit hole you want to go there are a number of useful guides about this. The Node.js TCP API is actually pretty great.

Ex. https://www.hacksparrow.com/tcp-socket-programming-in-node-js.html

Bob_Gneu
  • 1,591
  • 1
  • 18
  • 30
  • Now that I am looking this looks like a duplicate. http://stackoverflow.com/questions/10213501/communicating-between-two-different-processes-in-node-js – Bob_Gneu Nov 24 '16 at 00:52