Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a way to borrow the connection out of a PgListener #3549

Open
sandhose opened this issue Oct 8, 2024 · 0 comments · May be fixed by #3550
Open

Have a way to borrow the connection out of a PgListener #3549

sandhose opened this issue Oct 8, 2024 · 0 comments · May be fixed by #3550
Labels
enhancement New feature or request

Comments

@sandhose
Copy link

sandhose commented Oct 8, 2024

Is your feature request related to a problem? Please describe.
I'm working on a job queue in my project, which involves NOTIFY/LISTEN.
Ideally, I would like to react to notifications and reuse the same Postgres connection when I'm processing this notification.

Describe the solution you'd like

PgListener already implements Executor, which helps executing arbitrary queries with it, but my database abstraction would benefit from accessing the &mut PgConnection.
PgListener has a connection private method which gives that, but maybe it should just implement Acquire?

Describe alternatives you've considered
Opening a second connection, which feels wrong as when I'm processing notifications, the PgListener connection sits idle anyway.

Additional context
-

@sandhose sandhose added the enhancement New feature or request label Oct 8, 2024
@sandhose sandhose linked a pull request Oct 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant