How client side Handle node.js with multiple response from the server
Is it appropriate to make a fast phased realtime game app with node.js?
Are there ways or patterns to handle this?
Think of node as a commander, it handles the monitoring of task without any blocking. So if you think of it like that, node does not need to be multi threaded, it executes tasks without any wait time, therefore there is no need to create a new thread as nothing is blocked.
You mention about sockets in your comment, think of this, Node has a network thread that monitors the TCP/UDP connection for data, when it receives a packet it mealy ask's your node script what you would like done with this packet, you instantly tell the network thread to send this new packet out as a reply and then the network thread goes of to do that while then next event is called.
Take a look at the following image and paragraph, this should explain
In node.js, you aren’t supposed to worry about what happens in the backend: just use callbacks when you are doing I/O; and you are guaranteed that your code is never interrupted and that doing I/O will not block other requests without having to incur the costs of thread/process per request (e.g. memory overhead in Apache).
Having asynchronous I/O is good, because I/O is more expensive than most code and we should be doing something better than just waiting for I/O.
An event loop is “an entity that handles and processes external events and converts them into callback invocations”. So I/O calls are the points at which Node.js can switch from one request to another. At an I/O call, your code saves the callback and returns control to the node.js runtime environment. The callback will be called later when the data actually is available.
Be sure to read that article it was the first article that made me fully understand what was going on with the back-end architecture.