I have a collection with a particular field “end_time” which is a timestamp. I would like to find the best way to trigger an action while this timestamps passes the now() time.
I have some ideas but would very much enjoy some leads :
Using CRON package ? I don’t really know how they work yet, but it seems it has some similarities with my problem ? Could you confirm ? recommend a particular package ?
Looping a method on server : I was thinking to loop a method (every minute for example) through all my collection and each time the timestamp has passed the field timestamp, and the action has not yet beeing called, it will trigger it. I am bit scared of the ressources it may use. Also if once there is a probleme with the script or data, isn’t there a risk it’ll stop fully the script and never restart it until I restart server ?
Ideally I would kind of need a tracker, that would track the end_time timestamp of my collection ? Is it doable ? any leads ?
A bit lost here to be honest, hoping to read from you guys.