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

Implement Acquire for PgListener #3550

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sandhose
Copy link

@sandhose sandhose commented Oct 8, 2024

Does your PR solve an issue?

Fixes #3549

@CommanderStorm
Copy link
Contributor

(not a maintainer)
Could you add a testcase to ensure that this continues to work in the future? ^^

@sandhose
Copy link
Author

sandhose commented Oct 9, 2024

(not a maintainer) Could you add a testcase to ensure that this continues to work in the future? ^^

Good suggestion, I've just added that!

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit.

type Connection = &'c mut PgConnection;

fn acquire(self) -> BoxFuture<'c, Result<Self::Connection, Error>> {
self.connection().and_then(|c| c.acquire()).boxed()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling c.acquire() is redundant and just creates an extraneous BoxFuture.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, fixed in 3752cbc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have a way to borrow the connection out of a PgListener
3 participants