Skip site navigation (1) Skip section navigation (2)

Re: implementing asynchronous notifications

From: Andras Kadinger <bandit(at)surfnonstop(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: implementing asynchronous notifications
Date: 2005-04-11 03:34:23
Message-ID: Pine.LNX.4.44.0504110519590.13042-200000@ns.surfnonstop.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Sun, 10 Apr 2005, Oliver Jowett wrote:

> It'll be tricky to do this from a single codebase as the NIO changes
> would need to reach right down to the underlying protocol stream.. it
> seems hard to localize the changes.

Okay, then I implemented this using Socket.getInputStream().available()  
calls.

Proof of concept attached.

PGConnection.getNotifies() now processes peding Async Notifies first - no
need to send polling queries to the server anymore. The result is zero
network traffic in the idle case.

Any comments?

I am unclear as to how to handle possible protocol errors (e.g. when what
we end up reading from the connection is not an 'A'sync Notify).  
Theoretically, in a working connection this should not happen though.

Attachment: processNotifies.patch
Description: text/plain (4.5 KB)

In response to

Responses

pgsql-jdbc by date

Next:From: Andras KadingerDate: 2005-04-11 03:51:29
Subject: Re: implementing asynchronous notifications
Previous:From: Oliver JowettDate: 2005-04-10 05:53:38
Subject: Re: implementing asynchronous notifications

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group