From: Tom Lane <tgl@sss.pgh.pa.us>
To: Igor Shevchenko <igor@carcass.ath.cx>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq/async notifications
Date: Tue, 14 Oct 2003 13:18:29 -0400
Message-ID: <10861.1066151909@sss.pgh.pa.us> (raw)
In-Reply-To: <200310141946.07374.igor@carcass.ath.cx>
References: <200310111220.25923.igor@carcass.ath.cx>
<9884.1066147821@sss.pgh.pa.us>
<200310141946.07374.igor@carcass.ath.cx>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, igor@carcass.ath.cx
Subject: Re: libpq/async notifications
In-Reply-To: <10861.1066151909@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox