Documentation
¶
Overview ¶
Package pglisten is the LISTEN half of a PostgreSQL LISTEN/NOTIFY wakeup: one goroutine holding a dedicated connection that wakes registered workers whenever a producer fires NOTIFY on the channel it watches.
Every durable queue in this codebase is a table a worker polls, and every one of them wants the same thing on top of the poll: a producer's write should wake a worker now rather than at the next tick. The mechanism is identical across queues — only the channel name differs — so it lives here once, with the channel as a parameter, rather than being copied per queue. The notification delivery queue and the managed-script run queue both use it.
A listener is an optimization, never a correctness requirement: every worker it wakes also polls, so a failed or absent listener degrades latency and nothing else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener wakes its notifiers on every NOTIFY received on one channel.
func New ¶
New constructs a Listener for the supplied DSN and channel. It does not connect until Start is called.