Synchronous LISTEN/NOTIFY?

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Synchronous LISTEN/NOTIFY?
Дата
Msg-id 3.0.5.32.20010105111617.0081f8c0@192.228.128.13
обсуждение исходный текст
Ответ на Re: (not) freeing cursors  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Ответы Re: Synchronous LISTEN/NOTIFY?
Список pgsql-general
Hi,

Say I have two applications A and B communicating via a postgresql
database. A sends data for B to work on.

How can I get B to _wait_ for a signal from A before proceeding?

Right now it looks like B has to keep polling regularly. So in order for
things to occur in a timely fashion the polling interval has to be
ridiculously short. This means using more CPU than I would like.

Is there a postgresql equivalent of a unix select/accept?

Basically LISTEN doesn't wait. It'll really be nice to have one which does
- lots of cool stuff can be done.

For example, I could have a webapp write trigger another app running as
root- the webapp writes high level stuff to the database, and a run-as-root
app does stuff based on it, this seems to be a more secure. Or I could have
a small app watch some logs for some event, send the data to a database.
Then another small app waits for a trigger and then uses some of that data
to do something else. Or we could even have a database level trigger, so
when a certain criteria is met, the waiting application is triggered.
Basically you now can have apps use the database for instant messaging :).

Is this sort of thing possible with postgresql or even other RDBMs?

Thanks,
Link.


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

Предыдущее
От: Blake Crosby
Дата:
Сообщение: Re: Time Zone Query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Synchronous LISTEN/NOTIFY?