Skip site navigation (1) Skip section navigation (2)

Re: libpq/async notifications

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Igor Shevchenko <igor(at)carcass(dot)ath(dot)cx>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq/async notifications
Date: 2003-10-14 16:10:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Igor Shevchenko <igor(at)carcass(dot)ath(dot)cx> writes:
> Is there a way to only check if there's any pending async notifications ?
> I've found only PQnotifies(..) but it also removes the first notification from 
> the list.
> A function for only checking this can be used in a gui app to setup async 
> notifications processing so it happens only after an app reaches it's main 
> loop (which is a good idea since it won't happen in the middle of another 
> app's handler function which happens to use pgsql database interface).
> Currently I have to check for notifications with PQnotifies every time my app 
> returns to the main loop after using any of PGexec, etc, which is not very 
> efficient.

"Not very efficient"?  This seems like a very weak argument.  The actual
cost of running the function is no different from PQnotifies in the case
where no notify event is found; and in the case where one is found, it'd
be slower because you'd then have to call PQnotifies anyway to remove
the item from the list.

Yes, I know the function is only five lines, but there are also
documentation and other maintenance costs to consider anytime we add
something to libpq's API.  I don't think you've made enough of a case
for it.

			regards, tom lane

In response to


pgsql-interfaces by date

Next:From: Brett MatonDate: 2003-10-14 16:38:35
Subject: Intercept database Connection request
Previous:From: D. StimitsDate: 2003-10-14 01:48:38
Subject: Re: [INTERFACES] more on undefined reference to 'pg_detoast_datum'

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group