# PgPubSub.on() method · @imqueue/pg-pubsub

Source: https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.pgpubsub.on_2/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-pubsub 3.0.5 — generated reference, not hand-written

Sets `'close'` event handler

**Signature:**

```typescript
on(event: 'close', listener: typeof close): this;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| event | 'close' | `'close'` — the connection was closed by close(), leaving it re-usable |
| listener | typeof close | handler invoked when the connection was closed by close(), leaving it re-usable. |


**Returns:**

this

