Re: Inter-app communication via DB

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: Inter-app communication via DB
Дата
Msg-id 20080619102607.GC4167@merkur.hilbert.loc
обсуждение исходный текст
Ответ на Re: Inter-app communication via DB  (David <wizzardx@gmail.com>)
Список pgsql-general
On Thu, Jun 19, 2008 at 11:46:42AM +0200, David wrote:

> > That will happen anyway, no matter what the message
> > transport is like. Apps will have to read state at startup
> > anyway, no ?
>
> I have a small problem with this. If app1 wants to tell app2 to
> perform an expensive operation (which you don't want app2 to do each
> time it starts up), in the original pattern it could just set a
> boolean variable. Now it needs to both set a boolean variable (in case
> app2 isn't running at the moment) and use NOTIFY (for when it is),
> which seems a bit redundant.

You could add a trigger to the table with the boolean flag.
The trigger sends the NOTIFY all by itself. So when the app
is listening it gets the signal. When it isn't it will read
the flag at startup. All the other app does is set the flag.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

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

Предыдущее
От: David
Дата:
Сообщение: Re: Dump and restore problem
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Understanding fsync