Implementing queue semantics (novice)

Поиск
Список
Период
Сортировка
От KÖPFERL Robert
Тема Implementing queue semantics (novice)
Дата
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB1653E@neptun.sonorys.at
обсуждение исходный текст
Ответы Re: Implementing queue semantics (novice)  (Andrew Hammond <ahammond@ca.afilias.info>)
Список pgsql-sql
Hi,

since I am new to writing stored procedures I'd like to ask first bevore I
do a mistake.

I want to implement some kind of queue (fifo). There are n users/processes
that add new records to a table and there are m consumers that take out
these records and process them.
It's however possible for a consumer to die or loose connection while
records must not be unprocessed. They may rather be processed twice.

This seems to me as a rather common problem. But also with atomicy-holes to
fall into.
How is this commonly implemented?


I can imagine an 'add' and a 'get' function together with one aditional
'processed' timestamp-column?



Thanks for helping me do the right.


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

Предыдущее
От: sad
Дата:
Сообщение: Re: Single row tables
Следующее
От: Andrew Hammond
Дата:
Сообщение: Re: Implementing queue semantics (novice)