I am currently running a nodejs process which sends a request to an array of several URLs every minute.
It uses the setTimeout to sleep and send the request each minute.
Is that possible to remove any of that items in the array from another nodejs process?
P.S. I simply have an admin interface where I remove these URLs, when a URL is removed I simply want to remove it from the array.
I can do this by checking the database each time before sending the request and if the URL is deleted, remove the item from the array but trying to do that without database checks each time for each URL.
Thanks much.
If you're running two totally separate processes, they could send each other signals:
(signal.kill sounds scary but it just sends a signal to another process)
You could also use redis as a really simple data sharing mechanism locally. Of course, you could also just use a file - if you're hitting seven URLs once per minute, a file would be just fine. Check out node-dirty for a nice interface: