# message() function · @imqueue/pg-pubsub

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

`'message'` event occurs each time database connection gets notification to any listening channel. Fired before channel event emitted.

**Signature:**

```typescript
export declare function message(chan: string, payload: AnyJson): void;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| chan | string | channel to which notification corresponding to |
| payload | [AnyJson](https://imqueue.org/api/pg-pubsub/latest/pg-pubsub.anyjson/) | notification message payload |


**Returns:**

void

