Instance Method
listen(on:consume:)
Listen to a channel and run closure with
PostgresNotificationSequence.func listen<Value>(on channel: String, consume: nonisolated(nonsending) (PostgresNotificationSequence) async throws -> Value) async throws -> Value
Parameters
channelThe channel to listen on.
consumeClosure that is called with a
PostgresNotificationSequence.
Discussion
When the closure is exited the UNLISTEN command is automatically sent for the provided channel.