4 ms·
for " Writing a task scheduler for your web-server in PHP" Is the author talking about "at" and "cron" instead ?
by allan_s 11y ago
for
" Writing a task scheduler for your web-server in PHP"
Is the author talking about "at" and "cron" instead ?
- jrgnsd 11y agoThere's a number of solutions, depending on your stack: at and cron are good OS level solutions. Sidekiq is great for Ruby. I think the problem lies in that PHP wasn't designed to be a long running process, and for a scheduler you need something long running.
- contingencies 11y agoHaving done this (years ago), there are good reasons sometimes. At the time I was working on a relatively complex hotel reservation system with a distributed database and the need for batch execution of background processes (things like sending emails and digital fax from a queue). The master interface to the database was a series of PHP functions since the data massaging that had to occur (to facilitate correct interaction in multiple human languages across disparate timezones versus user preferences and time of day, etc.) ruled out direct DB access from anywhere else, back-end processes included. I think the end solution was something like 'every minute run PHP X from cron, which checks if there are jobs, if so successively spawn children to handle'. It was basic but it worked. Godawful pain with MySQL replication over lossy Chinese internet WAN ... never again.
- jrgnsd 11y agoI inherited a similiar system. It was painful to say the least. I didn't realise how painful until I started using proper queueing systems and Sidekiq.
- contingencies 11y agoSidekiq doesn't really look that different to what we used. Anyway, neither decent ruby unicode handling nor RoR nor sidekiq existed back then. I actually considered rewriting the whole system in ruby at one point, but the unicode support was still dodgy.
- kisstheblade 11y agoWhat are good queue replacements? My problem with activemq et. al. style queues is that monitoring them is much harder than a simple database. Ie. checking for pending items in the queue and also for debuggin processed items later. And somehow I don't "trust" these queues as much as a simple database. If I write a row to the database it is there and can easily be checked and used (no queue product has any comman line utilities or sql like general functionality to check the queue etc.) The previously linked article also warns that do not use a database as the backend for the queue solution or you will have worst of both worlds...
- juliangregorian 11y agocron and a queue server are fundamentally different systems.