On 4/17/07, Ben Sgro (ProjectSkyline) <[EMAIL PROTECTED]> wrote:
1) Every x min, select the oldest time from the queue (LIMIT 1) 2) DELETE that row from the queue 3) Execute the job
Simple improvement would be to mark the job as "active" along with the pid of the process that is working on it, rather than deleting the record. That way if something goes wrong, you don't have to reinsert. Also, you can tell how many active jobs you have and decline to start new ones past a certain threshold. Think about what information you need for error recovery, too. After all, you probably only want to retry a "problem" job a certain number of times before giving up, notifying an admin, etc. -- Chris Snyder http://chxo.com/ _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php
