I am building a system that consists of 2 basic processes.
Part 1 is a program that adds elements to a queue. Part 2 is a group of programs that remove elements from the queue.
The queue could be up to 1 million elements in length. Items are added and removed at rates in the region of 1 to 10 per second. For various reasons it would be convenient if we could use mySQL, which is already installed on the server, to handle the queue. There needs be 1 table containing the individual elements in the queue and another table containing 1 or more data lines per entry.
I need some guidance as to a SQL query which will allow me to take an element from the queue, and all the associated data lines, and remove the element or mark it as processed. Obviously it is paramount the same item cannot be removed from the queue multiple times.
Any ideas or pointers? I've looked for information on implementing a FIFO system using a database but couldn't find anyhting.
Edit 2001-07-09 ar0n -- added paragraph tags
In reply to Queues, not the usual problem by rob_smith01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |