Skip to content

Expose Notification Listener #17

@wolframm

Description

@wolframm

Is there a way to access a connection and listen to its notifications directly from a PgPool instance?

I have a worker app that listens to various notification tasks and also updates the database when a task is done. At the moment I am using one PgPool instance plus a separate connection initialized using the postgres package.

final connection = PostgreSQLConnection(...);
connection.notifications.listen((event) async {
    if (event.channel == _taskName) await _sendEmails();
  });

final pool = PgPool(...);
await pool.execute('listen $_taskName;');

Please kindly provide a brief example if this is possible already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions