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

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

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

| Parameter | Type | Description |
| --- | --- | --- |
| event | 'end' | `'end'` — the underlying connection has ended and will not reconnect |
| listener | typeof end | handler invoked when the underlying connection has ended and will not reconnect. |


**Returns:**

this

