Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultMinReconnectInterval = 10 * time.Millisecond DefaultMaxReconnectInterval = time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener interface {
io.Closer
Listen(ctx context.Context, topic string, callback func(n *Notification)) error
}
Listener connects to PostgreSQL and listens to a channel with LISTEN. Listen calls the callback for every notification, with its JSON payload parsed, until the context is done. The default implementation, from NewListener, uses lib/pq; callers may implement Listener for another backend.
Click to show internal directories.
Click to hide internal directories.