Hello Again, 

I have questions about implementing a queue w/mySQL.

I was thinking the simplest way to build it would be as such:

job_queue table:
First[job_id, time][job_id+1, time+n]Last

1) Every x min, select the oldest time from the queue (LIMIT 1)
2) DELETE that row from the queue
3) Execute the job

A record is inserted into the que whever a user completes the job application 
wizard.
That new row contains (job_id, time( )).

Seems like a pretty simple way to build the queue. I think when I run jobs, 
they'll be forked off
so I can run multiple jobs. However, I have not considered how the parent 
process that forks
these children will watch over the jobs.

What if a job takes to long, I should prolly kill it, and reinsert it into the 
queue, plus keep track
of failures. We dont want to keep running a job that fails.

Any ideas?

- Ben


_______________________________________________
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

Reply via email to