Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DBReconnectMaxDuration = time.Minute * 5 DBReconnectBackoffBaseDuration = time.Second )
Functions ¶
func Listen ¶
Listen listens to PostgreSQL notifications on the specified channel. It acquires a dedicated connection.
The function blocks until the context is cancelled or an error occurs. On connection failure, it will automatically reconnect with exponential backoff.
func ListenMany ¶ added in v1.0.1081
func ListenMany(ctx context.Context, listeners ...ChannelListener) error
ListenMany listens to PostgreSQL notifications on the specified channels. It acquires a dedicated connection.
Multiple channels can be listened to and multiple listeners can be registered for the same channel - notifications will be sent to all receivers for that channel.
The function blocks until the context is cancelled or an error occurs.
func NewNotifyRouter ¶
func NewNotifyRouter() *notifyRouter
Types ¶
type ChannelListener ¶ added in v1.0.1081
ChannelListener represents a listener for a PostgreSQL notification channel.