Re: Listen / Notify rewrite
Alex <alex323@gmail.com>
From: Alex <alex323@gmail.com>
To: Andrew Chernow <ac@esilo.com>
Cc: Joachim Wieland <joe@mcknight.de>, Merlin Moncure <mmoncure@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgresql.org, Andrew Chernow <andrew@esilo.com>
Date: 2009-11-15T16:20:22Z
Lists: pgsql-hackers
On Thu, 12 Nov 2009 11:22:32 -0500 Andrew Chernow <ac@esilo.com> wrote: > > > However I share Greg's concerns that people are trying to use NOTIFY > > as a message queue which it is not designed to be. > > When you have an established libpq connection waiting for notifies it > is not unreasonable to expect/desire a payload. ISTM, the problem is > that the initial design was half-baked. NOTIFY is event-driven, ie. > no polling! > I agree. Wouldn't it make sense to allow the user to pass libpq a callback function which is executed when NOTIFY events happen? Currently we are forced to poll the connection, which means that we'll be checking for a NOTIFY every time we have new data. That just doesn't make sense. -- Alex