Re: Inter-app communication via DB

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Inter-app communication via DB
Date: 2008-06-19 10:26:09
Message-ID: 20080619102607.GC4167@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2008-06-19 11:11:34 Re: Understanding fsync
Previous Message David 2008-06-19 09:57:58 Re: Dump and restore problem