Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XlYeZ-0003TI-Mv for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2014 07:35:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XlYeZ-00034U-2m for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Nov 2014 07:35:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XlYeY-00034K-9j; Tue, 04 Nov 2014 07:35:46 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XlYeU-0001Pz-0u; Tue, 04 Nov 2014 07:35:45 +0000 Received: from ayaki.localdomain ([106.68.211.225]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0MaiSH-1XS6t72SrJ-00KBPd; Tue, 04 Nov 2014 08:35:37 +0100 Message-ID: <545881C4.10008@2ndquadrant.com> Date: Tue, 04 Nov 2014 15:35:32 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Scott Harrington , Mikko Tiihonen CC: "pgsql-hackers@postgresql.org" , "pgsql-jdbc@postgresql.org" Subject: Re: [JDBC] Pipelining executions to postgresql server References: <1414850643686.34687@nitorcreations.com> <20141101173116.GR13584@awork2.anarazel.de> <1414930308808.49160@nitorcreations.com>, <20141102122320.GB28295@alap3.anarazel.de> <1414934833900.88748@nitorcreations.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:se4HrH9TpOgwUAETWVteKpE1AmYky/RrzR5Z49BbHiQNPvsUZ0J YP2HAKJYD8qXvAfPXgYvAIreNVMvMGvTmVffBimQy1sISmyRoLCgdJg+npHh9Z7VqzCh6KZ Lkws+Z/3sI0i7CY7DG/M8sHhA9XH8yu4/XUEIJPQqaWe3T6q3DgIkGZa4uKXUI0Bt3+gRit P5C4CzXUv5vrez6EMrN+w== X-UI-Out-Filterresults: notjunk:1; X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 11/03/2014 07:05 AM, Scott Harrington wrote: > This avoids the need for a Future, and avoids the client having to > loop/sleep until done. A Future is the logical way to represent an asynchronous operation in Java. Why implement something else that doesn't fit into existing libraries and tools when there's already a standard interface? If you're breaking outside the stock JDBC model and thinking asynchronously, then using the existing Java APIs for asynchrony makes sense to me. In terms of looping until done ... what we really need is a reliably non-blocking PGConnection.consumeInput() so apps can call that in their main loops, or via a helper thread. Then we'd be able to add async notification callbacks too. To do that we need to make PGstream use a java.nio.Channel instead of a java.net.socket . -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers