Synchronous LISTEN/NOTIFY? - Mailing list pgsql-general

From Lincoln Yeoh
Subject Synchronous LISTEN/NOTIFY?
Date
Msg-id 3.0.5.32.20010105111617.0081f8c0@192.228.128.13
Whole thread Raw
In response to Re: (not) freeing cursors  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Responses Re: Synchronous LISTEN/NOTIFY?
List 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 by date:

Previous
From: Blake Crosby
Date:
Subject: Re: Time Zone Query
Next
From: Tom Lane
Date:
Subject: Re: Synchronous LISTEN/NOTIFY?