Re: libpq/async notifications - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: libpq/async notifications
Date
Msg-id 10861.1066151909@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq/async notifications  (Igor Shevchenko <igor@carcass.ath.cx>)
List pgsql-interfaces
Igor Shevchenko <igor@carcass.ath.cx> writes:
> The idea behind this checking function is to separate the *checking* if 
> there's any notifications and actually *processing* them. I want to check 
> right after any transaction or any PQ* function which calls PQconsumeInput 
> and process notifications only once, after my app had returned to it's main 
> loop (I'm talking about GUI apps here). In Qt, for example, this is done by 
> creating a new QEvent and dispatching it via QApplication::postEvent(...), 
> which is quite an overhead; with just PQnotifies I have to do this all the 
> time.

How so?  Seems to me the check operation could read
notify = PQnotifies(...);if (notify){    make QEvent, put notify pointer in it, dispatch}

The event handler then fetches the notify pointer from the QEvent
(and eventually frees it).
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Igor Shevchenko
Date:
Subject: Re: libpq/async notifications
Next
From: "Brett Maton"
Date:
Subject: Intercept database Connection request