List:General Discussion« Previous MessageNext Message »
From:Perrin Harkins Date:September 8 2009 1:08am
Subject:Re: Queue / FIFO in MySQL?
View as plain text  
On Mon, Sep 7, 2009 at 8:18 PM, Allen Fowler<allen.fowler@stripped> wrote:
> Note: In this scheme the worker winds up with all "new" records generated since the
> last worker claimed any. Not sure how else to guarantee atomicity. I would prefer "only n
> records per request". Ideas?

SELECT...FOR UPDATE followed by one or more UPDATEs in a transaction.
Either use MIN(id) to get the next lowest id or ORDER BY and LIMIT to
get n records at a time.

- Perrin
Thread
Queue / FIFO in MySQL?Allen Fowler8 Sep
  • Re: Queue / FIFO in MySQL?Hank8 Sep
  • Re: Queue / FIFO in MySQL?Perrin Harkins8 Sep
    • Re: Queue / FIFO in MySQL?Alex Arul Lurthu8 Sep
  • RE: Queue / FIFO in MySQL?Gavin Towey8 Sep
    • RE: Queue / FIFO in MySQL?Jerry Schwartz8 Sep