Skip to content

Control over connection pooling? #1253

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

Open
bennofs opened this issue Jul 10, 2017 · 3 comments
Open

Control over connection pooling? #1253

bennofs opened this issue Jul 10, 2017 · 3 comments
Labels
A-client Area: client.

Comments

@bennofs
Copy link

bennofs commented Jul 10, 2017

Right now, it seems that connection pooling is interwired with the http client itself. Does that have to be the case? Would it not be possible to implement pooling with a custom connector instead?

I have a program that generates a lot of connections, even though it only ever connects to the same server. I need to investigate a little bit more, but I'm assuming right now that for some reason, it is losing the race with the pool checkout quite often.

@mraerino
Copy link

@seanmonstar is there any work planned on this?

looks like the connection pool sits above the Connector instead of inside it, so you can't easily replace it right now.

which solution would you rather accept a PR for?

  • move connection pooling into connector
  • allow setting custom connection pool impl in Builder via some trait

@davidbarsky
Copy link
Contributor

@mraerino I can't comment if work on this is planned, but the the lower-level hyper::client::conn module would allow you build a high-level client with arbitrary pooling. If you chose to go down this path, I'd suggest looking at the internals of high-level Client.

@mraerino
Copy link

thanks for the suggestion!
a colleague suggested the same and i already implemented it that way with deadpool.

The boilerplate is actually pretty minimal, great stuff!

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

No branches or pull requests

4 participants