-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Adds feature for users to customize connections created by the pool #89
Conversation
Overall this is looking good, thanks for working on it! |
I think this is ready for another look. Removing |
bb8/src/inner.rs
Outdated
let conn = match shared.manager.connect().await { | ||
Err(e) => Err(e), | ||
Ok(mut c) => match self.on_acquire_connection(&mut c).await { | ||
Err(e) => Err(e), | ||
Ok(_) => Ok(c), | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repeated Err(e) => Err(e)
arms can probably be factored out by using some combinators, can you look into that? And while you're in there, please add an empty line between first let conn = match
and match conn {
blocks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Looks a bit more compact.
This is looking good, some minor style things and then I think this is good to merge! |
Thanks! |
Co-authored-by: Antoine Gersant <[email protected]>
Co-authored-by: Antoine Gersant <[email protected]>
Is this supposed to run when the connection is first created, or every time it's checked out?
Also would be nice to document that it applies to |
Implementation for #88
I ended up running into not too many issues!