I\'m working on an online PHP application that has a need for delayed PHP event. Basically I need to be able to execute arbitrary PHP code x many seconds (but it could be da
I am not sure why you are trying to avoid cron. You could create a queue of requests in a table, and have cron fire up a process to check for current jobs.
There are a few issues, depending on your exact requirements. For instance:
So if you want precise execution, or execution takes longer than a second, or there is the potential for a heavy load, then the cron approach can run into problems.
I have many daeons that run PHP (using daemontools). With this approach you could hold the requests in core and perform whatever timing you wanted internally.
However if exact and relaible timing is what you want you should probably move away from PHP altogether.