listen

abstract suspend fun listen(channel: String, f: suspend (Notification) -> Unit)(source)

Listens for notifications on a specified PostgreSQL channel and executes a callback for each received notification.

Parameters

channel

The name of the PostgreSQL channel to listen on. The channel name must be valid according to PostgreSQL's naming rules.

f

The callback function to be executed whenever a notification is received on the specified channel. The callback receives a Notification object containing details of the notification.


abstract suspend fun listen(channels: List<String>, f: suspend (Notification) -> Unit)(source)

Listens for notifications on specified PostgreSQL channels and executes a callback for each received notification.

Parameters

channels

A list of PostgreSQL channel names to listen on. Each channel name must be valid according to PostgreSQL's naming rules.

f

The callback function to execute whenever a notification is received on any of the specified channels. The callback receives a Notification object containing details of the notification.