This works because 2 racing operations will be ordered one after the
other in Redis, so one will actually win, and one will get the 5 as a
result, while the other gets a 6.
- Josiah
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.
>
>
I was thinking perhaps a LIST of timeouts? but that would still have its
own issues, though it shouldn't seize up?
--
Luke Antins
http://lividpenguin.com
Andy Lawman wrote:
>
> One way to approach this is to issue an INCR when you wish to start a
> job without first testing the value. If the response is <= 5 then
> simply run the job as you describe. If it's > 5 issue a DECR, don't
> run the job and requeue it.
>
> Andy.
>
>
>
> From: Karl <karl...@gmail.com>
> To: Redis DB <redi...@googlegroups.com>
> Date: 18/10/2010 15:42
> Subject: redis counter to limit jobs running
> Sent by: redi...@googlegroups.com
> ------------------------------------------------------------------------
> Hounslow, Middlesex, TW6 2TA, Registered number 4040059 --
- Josiah
--
Luke Antins
http://lividpenguin.com