Monday 8 February 2016

How to trigger time-based events

Hey guys,I'm just building a webapp (with sailsJS), which requires to trigger events after a certain amount of time and I can't come up with a good idea. Right now I'm thinking about using setTimeout(), but the delays would be super long (could be up to several hours) and I don't think the function is supposed to handle such scenarios. Another idea I had was to use setInterval() and check the time every minute or so, but wouldn't that be the same as my first idea? Is there some kind of code that allows me to trigger a function at a specific date or time?Anyway, does anyone have experience with problems like that? I would love to hear what you came up with!

Submitted February 08, 2016 at 04:33PM by bobbythecreator

No comments:

Post a Comment