X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 30C0AD1B4F1 for ; Tue, 14 Oct 2003 17:19:02 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 50231-08 for ; Tue, 14 Oct 2003 14:18:31 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 23F85D1B54E for ; Tue, 14 Oct 2003 14:18:30 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9EHIThn010862; Tue, 14 Oct 2003 13:18:29 -0400 (EDT) To: Igor Shevchenko Cc: pgsql-interfaces@postgresql.org Subject: Re: libpq/async notifications 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> Comments: In-reply-to Igor Shevchenko message dated "Tue, 14 Oct 2003 19:46:07 +0300" Date: Tue, 14 Oct 2003 13:18:29 -0400 Message-ID: <10861.1066151909@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/32 X-Sequence-Number: 4521 Igor Shevchenko 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