On Thu, Jun 28, 2012 at 8:04 AM, Anthony <abasta...@gmail.com> wrote:
>> > Anyway, you might be better off looking into using the scheduler, or a
>> > third-party task queue like Celery (a web2py Celery plugin was started
>> > at
>> > some point, though not sure it is complete).
>>
>> I don't understand, how will that let me do a read-modify-update
>> transaction? It seems as if for_update is precisely what I need to do
>> that.
>
> I thought your original goal was to set up a task queue -- those suggestions
> are specialized for that purpose.

Yes, it is. The email-queue example in The Book has a caveat that only
one server can be used. That's because with more than one server
process, the same work item might be processed several times. If I had
a read-modify-update transaction, then a server could mark a
particular work item as taken/in-progress and it wouldn't matter how
many servers I had. It would work with just one, or if I needed to
spin up a few more, I could that without introducing errors,
race-conditions, etc. Right?

-=Doug

Reply via email to