NodeJS Performance challenges
Processing long running queries with Node
Since Node is single-threaded, there is a need of workaround if it comes to a long-running calculations.
Note: this is "ready to run" example. Just, don't forget to get jQuery and install the required modules.
Main logic of this example:
1. Client sends request to the server.
2. Server starts the routine in separate node instance and sends immediate response back with related task ID.
3. Client continiously sends checks to a server for status updates of the given task ID.
Disclaimer: this example is intended to give you basic idea. To use it in production environment, it needs improvements.