Re: Inter-app communication via DB

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Inter-app communication via DB
Дата
Msg-id 200806191521.09507.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на Inter-app communication via DB  (David <wizzardx@gmail.com>)
Список pgsql-general
Le jeudi 19 juin 2008, David a écrit :
> One pattern I've used is for apps to communicate events to each other
> through the database.
>
> ie:
>
> - App 1 sents a boolean value to True
> - App 2 queries the field every 10s, sets the value to False, and does
> something.
>
> Is this reasonable, or should apps avoid this pattern?

The PGQ package from skytools allows you to produce events into a queue from
the provider side and retrieve them at the consumer(s) side. The consumer(s)
needs not be running while the provider produces them, this will simply cause
lag.

The consuming of events has the options to set any event processing as failed
or retry.

PGQ comes with several APIs, the common one is its SQL one, atop of it reside
both a python one and (recently) a PHP one.

You might want to read those URLs to get more ideas about it, but I'd
definitely consider using PGQ in your case:
 http://skytools.projects.postgresql.org/doc/pgq-sql.html
 http://www.pgcon.org/2008/schedule/events/79.en.html

http://kaiv.wordpress.com/2007/10/19/skytools-database-scripting-framework-pgq/

Regards,
--
dim

Вложения

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: pg_locks "at-a-glance" view
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: Re: pg_locks "at-a-glance" view