forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNpgsqlNotificationEventArgs.cs
More file actions
47 lines (40 loc) · 1.45 KB
/
NpgsqlNotificationEventArgs.cs
File metadata and controls
47 lines (40 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using Npgsql.Internal;
namespace Npgsql;
/// <summary>
/// Provides information on a PostgreSQL notification. Notifications are sent when your connection has registered for
/// notifications on a specific channel via the LISTEN command. NOTIFY can be used to generate such notifications,
/// allowing for an inter-connection communication channel.
/// </summary>
public sealed class NpgsqlNotificationEventArgs : EventArgs
{
/// <summary>
/// Process ID of the PostgreSQL backend that sent this notification.
/// </summary>
// ReSharper disable once InconsistentNaming
public int PID { get; }
/// <summary>
/// The channel on which the notification was sent.
/// </summary>
public string Channel { get; }
/// <summary>
/// An optional payload string that was sent with this notification.
/// </summary>
public string Payload { get; }
/// <summary>
/// The channel on which the notification was sent.
/// </summary>
[Obsolete("Use Channel instead")]
public string Condition => Channel;
/// <summary>
/// An optional payload string that was sent with this notification.
/// </summary>
[Obsolete("Use Payload instead")]
public string AdditionalInformation => Payload;
internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
{
PID = buf.ReadInt32();
Channel = buf.ReadNullTerminatedString();
Payload = buf.ReadNullTerminatedString();
}
}