3 ms·
Almost everyone I know just uses cron or various proprietary replacements for cron that work basically the same way. If you want to go the proprietary way, you
by nostrademons 16y ago
Almost everyone I know just uses cron or various proprietary replacements for cron that work basically the same way. If you want to go the proprietary way, you write a persistent daemon server that keeps a priority queue of tasks to execute, wakes up and executes the next one on the heap, figures out what time it is, and then sleeps until the next task is due. If it receives notifications of new tasks, it wakes up, adds them to the heap, and then recomputes the amount of time it must sleep.