3 ms·
I like the feel of it and the thought behind it, but ... while true, sleep? I get very uncomfortable with any kind of polling, especially polling timers for ch
by AnthonBerg 11y ago
I like the feel of it and the thought behind it, but ... while true, sleep?
I get very uncomfortable with any kind of polling, especially polling timers for checking for jobs with timespans between them. Maybe it's just me?
- est 11y agoevery cron or cron-like service has some kind of polling behind. Beanstalk, redis-queue, you name it. Many open source redis based scheduler are all implemented in a sleep(5) loop. Even the Unix cron is implemented with a sleep() call https://en.wikipedia.org/wiki/Cron#History https://en.wikipedia.org/wiki/Cron#History
- drudru11 11y agoAs another commentor noted, this is the way every system is implemented. It is simple, slightly inefficient, and deals with most of the nasty problems that arise when dealing with time on all systems today.