based on http://www.devart.com/dotconnect/postgr ... on_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? ... tification it says "asynchronous notifications are not supported yet". That message was posted over 6 years ago. Are *truly* asynchronous notification supported *now*?
Asyncronous PgSqlConnection.Notification event
-
- Posts: 5
- Joined: Mon 27 Jan 2014 15:49
-
- Posts: 5
- Joined: Mon 27 Jan 2014 15:49
Re: Asyncronous PgSqlConnection.Notification event
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
It might be a good idea for Devart to mention about the PgSqlAlerter class in the documentation for PgSqlConnection.Notification
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Asyncronous PgSqlConnection.Notification event
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.
PgSqlAlerter does not provide truly asynchronous notifications.
Thank you for the feedback, we have added this information to our documentation.szaslavsky wrote:It might be a good idea for Devart to mention about the PgSqlAlerter class in the documentation for PgSqlConnection.Notification
-
- Posts: 5
- Joined: Mon 27 Jan 2014 15:49
Re: Asyncronous PgSqlConnection.Notification event
Based on my experiments it "looks" asyncronous. So how does PgSqlAlerter work? Does it send "select 1" to the server over and over?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Asyncronous PgSqlConnection.Notification event
PgSqlAlerter starts a separate thread which listens to the notification queue of a server for notifications. No additional queries, like "SELECT 1", are performed.