Skip to content

PgNotifyProvider

PgNotifyProvider = object

Defined in: packages/postgres/src/notify-provider/notify-provider.pg.ts:7

PostgreSQL notify provider interface.

Abstracts PostgreSQL LISTEN/NOTIFY operations. The provider manages connections internally - no explicit context management required.

optional close?: () => Promise<void>

Defined in: packages/postgres/src/notify-provider/notify-provider.pg.ts:30

Releases provider-owned resources (e.g. a dedicated LISTEN client). Optional — pass-through providers (user-owned pool/client) can omit it. When defined, must be idempotent: the second call is a no-op, and after close publish and subscribe reject.

Promise<void>


publish: (channel, message) => Promise<void>

Defined in: packages/postgres/src/notify-provider/notify-provider.pg.ts:12

Publishes a message to a channel. Internally acquires a connection, publishes, and releases.

string

string

Promise<void>


subscribe: (channel, onMessage) => Promise<() => Promise<void>>

Defined in: packages/postgres/src/notify-provider/notify-provider.pg.ts:19

Subscribes to a channel. The provider manages a dedicated listen connection internally. Returns an unsubscribe function.

string

(message) => void

Promise<() => Promise<void>>