Been playing around with node.js and I am developing a file uploading web app as a learning experience. Now I have worked out most components of this apart from 1. Which is after a successful file upload in to a quarantine folder after a upload is complete I want to spawn off a independent process in node.js which scans the file and moves file if clean. In the mean time I wish for the upload to return a response that file was successful and to tell them that it will take a few minuets for scan to finish.
How would I go about spawning such a background process in node js please?
Well maybe Kue is the solution, here’s a nice video tutorial about it: http://nodetuts.com/tutorials/27-kue-jobs.html
Basically in your main app you put some tasks in the queue, and in the other process you execute them based on priority (it’s ok since you don’t want them to be executed right away).
Also I this is a lot better than spawning a process per each file upload.