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

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

Sets `'error'` event handler, which fired only one single time

**Signature:**

```typescript
once(event: 'error', listener: typeof error): this;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| event | 'error' | `'error'` — an error occurred, including exhausting the reconnect limit |
| listener | typeof error | handler invoked when an error occurred, including exhausting the reconnect limit. Fires at most once. |


**Returns:**

this

