In nodejs is there a mechanism for dynamically having code that checks for updates and then runs said updates?
For example, I've got a distributed computing network with dozens (and plan to expand to hundreds) of workers.
When I update the 'worker' code, in order to actively implement on all the worker systems, I need to go to each system and stop node, copy the updated file, and then restart node.
I was thinking I could wrap the entire thing in a wrapper that goes out and periodically checks for updates (or just gets them via an HTTP request from a master server). When it sees new code, it unloads the currently runny process, grabs the new code, and starts a new process with that code... but I'm unsure how to dynamically unload and reload code in nodejs. Perhaps a call to an exec?
Questions such as Loading remote js file using require with node.js are similar... but not exactly what I'm looking for - as those are only loading remote files on startup.
Guidance?