Asyncronous PgSqlConnection.Notification event

Asyncronous PgSqlConnection.Notification event

Postby szaslavsky » Mon 27 Jan 2014 16:01

based on http://www.devart.com/dotconnect/postgresql/docs/Devart.Data.PostgreSql~Devart.Data.PostgreSql.PgSqlConnection~Notification_EV.html I see that the PgSqlConnection.Notification event is not really asynchronous. It is only raised when the client calls PgSqlConnection.ExecuteXXXX which makes it synchronous. This approach is pretty wasteful from a resource standpoint and adds latency to the process of delivering a "NOTIFY" to user code.

In http://forums.devart.com/viewtopic.php?f=3&t=10158&hilit=notification it says "asynchronous notifications are not supported yet". That message was posted over 6 years ago. Are *truly* asynchronous notification supported *now*?
szaslavsky
 
Posts: 5
Joined: Mon 27 Jan 2014 15:49

Re: Asyncronous PgSqlConnection.Notification event

Postby szaslavsky » Tue 28 Jan 2014 16:41

To answer my own question: the way to get truly async notification is to use the PgSqlAlerter class.

It might be a good idea for Devart to mention about the PgSqlAlerter class in the documentation for PgSqlConnection.Notification
szaslavsky
 
Posts: 5
Joined: Mon 27 Jan 2014 15:49

Re: Asyncronous PgSqlConnection.Notification event

Postby Pinturiccio » Wed 29 Jan 2014 16:17

dotConnect for PostgreSQL does not support asynchronous notification. We will investigate the possibility to implement asynchronous notification, but we can't tell any timeframe at the moment.

PgSqlAlerter does not provide truly asynchronous notifications.

szaslavsky wrote:It might be a good idea for Devart to mention about the PgSqlAlerter class in the documentation for PgSqlConnection.Notification

Thank you for the feedback, we have added this information to our documentation.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44

Re: Asyncronous PgSqlConnection.Notification event

Postby szaslavsky » Wed 29 Jan 2014 20:44

Based on my experiments it "looks" asyncronous. So how does PgSqlAlerter work? Does it send "select 1" to the server over and over?
szaslavsky
 
Posts: 5
Joined: Mon 27 Jan 2014 15:49

Re: Asyncronous PgSqlConnection.Notification event

Postby Pinturiccio » Thu 30 Jan 2014 14:24

PgSqlAlerter starts a separate thread which listens to the notification queue of a server for notifications. No additional queries, like "SELECT 1", are performed.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL