I want to execute a script based on a condition at a time interval until some other condition is met.
Let me explain more; For example, I have a system for a delivering goods to clients. I'm working on this feature where a client requests goods to be delivered, now after the request has been placed. I want to notify my clients every 5 minutes or 3 times if they would want to cancel their request before its too late.
I'm working with php and I cant seem to find a way to implement this feature, at first I was going to use a cron job but couldn't find a way of executing a cron job in my php script. I don't know if cron jobs could be used in this scenario or not.
I cant seem to find any way of solving this problem.
At first I didn't think through well enough and figured cron jobs could come to my rescue but i just realized I couldn't find any way of calling a cron job from php code, or executing a php script at some interval without consuming too many server resource, or the script timing out.
Is there anyway to solve this issue. Thank you.