Re: queueing via database table?

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: queueing via database table?
Дата
Msg-id E43DE9CF-3C9D-4635-A4A2-1B58AA444A7E@khera.org
обсуждение исходный текст
Ответ на Re: queueing via database table?  (Steve Atkins <steve@blighty.com>)
Список pgsql-general
On Jan 3, 2007, at 2:00 AM, Steve Atkins wrote:

> Holding a lock while generating the thumbnail doesn't
> sound like a great idea, and I think that the select
> for update will end up serialising the requests.
>
> I'd add a "rendering" field, text, defaulting
> to an empty string.
>
> Then do a "select for update where ... and rendering = '' limit 1",
> update the rendering field to the hostname of the box doing the
> work and commit. Render the thumbnail. Delete the record.
>
> That'll also give you an easy way to show status of which
> box is rendering which scene.
>
> Depending on what else you're putting into the where clause
> a partial index on something for records where rendering=''
> might be helpful.

this is more or less how we do it, so i second this.

we also use NOTIFY/LISTEN to "wake up" the job processors when new
work is added.


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: pg_dump problems
Следующее
От: Bob Pawley
Дата:
Сообщение: Re: Backup Restore