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.