-
Notifications
You must be signed in to change notification settings - Fork 874
Expand file tree
/
Copy pathNpgsqlNotificationEventArgs.cs
More file actions
35 lines (30 loc) · 1.09 KB
/
NpgsqlNotificationEventArgs.cs
File metadata and controls
35 lines (30 loc) · 1.09 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
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; }
internal NpgsqlNotificationEventArgs(NpgsqlReadBuffer buf)
{
PID = buf.ReadInt32();
Channel = buf.ReadNullTerminatedString();
Payload = buf.ReadNullTerminatedString();
}
}