Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixes for bb8 #321

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

Merged
merged 2 commits into from
Mar 2, 2018
Merged

Fixes for bb8 #321

merged 2 commits into from
Mar 2, 2018

Conversation

khuey
Copy link
Contributor

@khuey khuey commented Jan 30, 2018

To write bb8 (https://github.com/khuey/bb8) I made a few modifications to tokio_postgres. These do change the exposed interface.

  • Handshake no longer consumes itself. This wasn't necessary and allows a single Handshake to be shared among multiple connections.
  • An is_desynchronized is added, mirroring the one in sync postgres.
  • The TlsMode enum now holds references, like its equivalent in sync postgres. This requires bounding a couple futures to the lifetime of the TlsMode. I expect this to be the most controversial part. Since you can still shove your Handshake in a lazy_static! to get the static lifetime if you really need it I don't think this is a huge issue.

@sfackler
Copy link
Owner

sfackler commented Feb 2, 2018

You can't put a Handshake in a lazy_static if it needs any runtime-derived configuration. I think it may make more sense for bb8 to define a trait MakeHandshake { fn make_handshake(&self) -> Box<Handshake>; } instead?

@khuey
Copy link
Contributor Author

khuey commented Feb 6, 2018

If it needs runtime configuration other than environment variables or similar, sure. Do you know of examples of usage that I can look at?

@sfackler
Copy link
Owner

sfackler commented Feb 7, 2018

I don't know of any public examples offhand, but it's relatively common for an application to read a config file and initialize things based off of that at startup, including its connection pool.

@khuey
Copy link
Contributor Author

khuey commented Feb 22, 2018

Alright lets just drop those csets then.

@khuey
Copy link
Contributor Author

khuey commented Mar 2, 2018

Poke?

@sfackler sfackler merged commit f76a292 into sfackler:master Mar 2, 2018
@khuey
Copy link
Contributor Author

khuey commented Mar 2, 2018

ty!

@khuey khuey deleted the bb8-fixes branch May 1, 2018 01:21
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.

2 participants