Today we talked all about Queues. Not just the shift/unshift kind of queues, but the good stuff – those database-driven, keeps everything from happening at once kind of queues.
You can find the presentation in both [url=http://kcpug.org/doghouse/2006_sep/Queues.swf]SWF[/url] and [url=http://kcpug.org/doghouse/2006_sep/Queues.odp]ODF (OOO Impress)[/url] formats.
Feel free to start a discussion! What other Queues have you built? What else could you use this concept for? Any thing that you know of that makes working with Queues even easier? Don’t be shy, feel free to add a comment!
If you are going to have a queue that is being read by more than one process at the same time, it is essential that your database supports row level locking. You can get away with table-level locking, but you might start getting into a delay as you add more processes.
So, for example, a background process looking to do work would:
This way, if you had 3 servers with 2 of these processes on each, you would not have to worry about duplication of work.
Enjoy the Show!