I may miss the obvious trick here, but ...
Is there anyway for 2+ processes node.js for stateful messaging? As an example: process A is an HTTP server that portes incoming external HTTP requests, to fulfill these requests it needs to get information from process B or C. Currently I have an “A” that opens a TCP / IP connection for each request for 'B' or 'C' that are listening on a suitable port.
This seems completely juicy and a lot of overhead, since each request requires a lot of overhead to open the socket and close it, but without opening the socket on the request, I see no way to make sure that the response from “B” or “C” is associated with correct HTTP response.
All processes are in nodes, B + C have a long start time (30 + seconds), so their spawning at the request is not an option. All processes currently operate in the same field (dual core).
In terms of the protocol, all I use is the base net 'server, as described in nodejs docs, and throwing text through it.
Any suggestions, etc. gladly accepted
source share