Skip to content

Support async Listen/Notify API #262

Closed
@fabianfett

Description

@fabianfett

The current Listen/Notify is not usable in a structured concurrency context. We should provide something better:

Goals

  1. Provide a new method on connection:

    public func listen(_ channel: String) async throws -> PostgresNotificationSequence
  2. The new PostgresNotificationSequence can be backed by an AsyncThrowingStream<String> internally. However we should not expose this, as this gives us greater flexibility down the road.

  3. We should create a ListenStateMachine in the PostgresConnection that we update for each Listen channel.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions