Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz2H0-0002L8-Df for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Feb 2019 16:41:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gz2Gz-0002zH-9S for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Feb 2019 16:41:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gywkq-0002fc-SK for pgsql-jdbc@lists.postgresql.org; Wed, 27 Feb 2019 10:48:01 +0000 Received: from mail2.dalim.com ([145.253.191.74]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gywkj-00005O-Lb for pgsql-jdbc@postgresql.org; Wed, 27 Feb 2019 10:47:55 +0000 Received: from localhost (localhost [127.0.0.1]) by mail2.dalim.com (Postfix) with ESMTP id 6BA89166020; Wed, 27 Feb 2019 11:47:49 +0100 (CET) Received: from mail2.dalim.com ([127.0.0.1]) by localhost (mail2.dalim.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zMQwDu0e32ot; Wed, 27 Feb 2019 11:47:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail2.dalim.com (Postfix) with ESMTP id B712B166022; Wed, 27 Feb 2019 11:47:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.9.2 mail2.dalim.com B712B166022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalim.com; s=C5CD85AE-9875-11E7-8F4E-7B36B4C25526; t=1551264468; bh=MemrgkSQyAYCUfsS3GsOUAf1zTGJYJZz/GhLxz+cYuQ=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type; b=FNhbyZsAm5bkKyLTjcwVlaaAH1ah6/b3PvkGXmGhTMx56+oGsOTffWHrTAaKd4e1n 0yEtRBtbj4wHWkn1Fmenyv/onKGoT6s8Rs0ulsnodOoXWvTSY5R037HJ9YJZF8txkm q28EciCtjQfVGQhBC+ucfHFgIujd63ZH/x9dtQrE= X-Amavis-Modified: Mail body modified (using disclaimer) - mail2.dalim.com X-Virus-Scanned: amavisd-new at dalim.com Received: from mail2.dalim.com ([127.0.0.1]) by localhost (mail2.dalim.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id flyrnwEqinqM; Wed, 27 Feb 2019 11:47:48 +0100 (CET) Received: from mail2.dalim.com (localhost [127.0.0.1]) by mail2.dalim.com (Postfix) with ESMTP id 88499166020; Wed, 27 Feb 2019 11:47:48 +0100 (CET) Date: Wed, 27 Feb 2019 11:47:48 +0100 (CET) From: Philippe Ebersohl To: "David G. Johnston" , Dave Cramer Cc: List Message-ID: <1000052273.5516163.1551264468429.JavaMail.zimbra@dalim.com> In-Reply-To: References: <1058674020.3669693.1550249725415.JavaMail.zimbra@dalim.com> <1855336325.5176233.1551086100885.JavaMail.zimbra@dalim.com> Subject: Re: A method to asynchronously LISTEN ? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5516162_401114649.1551264468429" X-Mailer: Zimbra 8.6.0_GA_1153 (ZimbraWebClient - SAF12 (Mac)/8.6.0_GA_1153) Thread-Topic: A method to asynchronously LISTEN ? Thread-Index: zS5fZ8Vt0e9hQcdaAMOcIBZPBR8x8g== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_5516162_401114649.1551264468429 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I do not think there is a need for something like conn.listenSync(). We were just intrigued about the test. In fact the current proposition should just work fine and we would like to test it. How could we have access to a postgresql-*.jdbc.jar that includes this feature ? Regards, Philippe From: "David G. Johnston" To: "Dave Cramer" Cc: "Philippe Ebersohl" , "List" Sent: Tuesday, 26 February, 2019 22:17:12 Subject: Re: A method to asynchronously LISTEN ? On Tue, Feb 26, 2019 at 12:04 PM Dave Cramer < pg@fastcrypt.com > wrote: On Tue, 26 Feb 2019 at 12:29, David G. Johnston < david.g.johnston@gmail.com > wrote: BQ_BEGIN The question being asked is whether executeUpdate method performs synchronous execution of the listener function queue during its execution. This after sending the command to the server and the server completing execution of the NOTIFY. This assumes that the server places the notification on the channel for pick-up immediately (which will not be the case within a transaction). While the client is, IIRC, synchronous, thus the local order of operations can be controlled, the server is asynchronous and thus this test is exposed to timing issues. Maybe we need something like conn.listenSync() that blocks until a notification payload is received on the connection...? kind of defeats the asynchronous aspect, no ? BQ_BEGIN BQ_BEGIN BQ_BEGIN BQ_END BQ_END BQ_END BQ_END You'd still want an asynchronous API for people but JavaScript introduced the "async/await" feature for a reason. In this case making it "sync" instead of coding up wait loop seems desirable. That said its quite possible I'm missing some existing feature as I haven't used this API at all. David J. ------=_Part_5516162_401114649.1551264468429 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,
I do not think there is a need for something like conn.listenSync().
We were just intrigued about= the test.

=
In fact the current proposition should just work fine and we = would like to test it.
How could we have access t= o a postgresql-*.jdbc.jar that includes this feature ?

Regards,
Philippe 



From: "David G. Johnston" <david.g.j= ohnston@gmail.com>
To: "Dave Cramer" <pg@fastcrypt.com><= br>Cc: "Philippe Ebersohl" <philippe.ebersohl@dalim.com>, "Lis= t" <pgsql-jdbc@postgresql.org>
Sent: Tuesday, 26 February, = 2019 22:17:12
Subject: Re: A method to asynchronously LISTEN ?

<= span style=3D"font-family: Arial,Helvetica,sans-serif;" data-mce-style=3D"f= ont-family: Arial,Helvetica,sans-serif;">On Tue, Feb 26, 2019 at 12:04 PM D= ave Cramer <pg@fas= tcrypt.com> wrote:
=


On Tue, 26 Feb 2019 at 12:29, David G. John= ston <da= vid.g.johnston@gmail.com> wrote:
The question being asked is whet= her executeUpdate method performs synchronous execution of the listener fun= ction queue during its execution.

This after sending = the command to the server and the server completing execution of the NOTIFY= .  This assumes that the server places the notification on the channel= for pick-up immediately (which will not be the case within a transaction).=

While the client is, IIRC, synchronous, thus the loc= al order of operations can be controlled, the server is asynchronous and th= us this test is exposed to timing issues.  Maybe we need something lik= e conn.listenSync() that blocks until a notification payload is received on= the connection...?

kind of defeats = the asynchronous aspect, no ?
<= blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; border= -left: 1px solid #cccccc; padding-left: 1ex;" data-mce-style=3D"margin: 0px= 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">


You'd still want an asynch= ronous API for people but JavaScript introduced the "async/await" feature f= or a reason.  In this case making it "sync" instead of coding up wait = loop seems desirable.  That said its quite possible I'm missing some e= xisting feature as I haven't used this API at all.

David J.


= 3D"Visit=0A
= ------=_Part_5516162_401114649.1551264468429--