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

Does "Reuse a connextion" preserve state #86

Closed
lud opened this issue Mar 3, 2014 · 2 comments
Closed

Does "Reuse a connextion" preserve state #86

lud opened this issue Mar 3, 2014 · 2 comments

Comments

@lud
Copy link

lud commented Mar 3, 2014

Hi,

I find the doc is unclear about whether or not hackney preserves state when reusing a connection e.g. read cookies and send them back on the next request.

I've read the code and i'm truly sure it does, and if it wouldn't the point of reusing a connection would be zero, but i think the readme should be more explicit about that. Because that's what I was looking for when I found hackney, and I bet there are many people looking for this functionality.

I'm sorry not providing a pull request, but I'm not fluent enough in english.

edit: btw, the readme file mentions hackney_http_proxy:connect_proxy/5 which doens't seem to exist anymore.

@benoitc
Copy link
Owner

benoitc commented Mar 3, 2014

Right now, reuse means reuse the socket. No state is kept and you need to store the cookie somewhere in your application if you need it.

The point of reusing connections is to reduce the number of opened connections on your machines. If your server is handling keepalive then you have good chances to reuse the last connection.

@lud
Copy link
Author

lud commented Mar 4, 2014

Oh, yes i wish i hadn't said it was pointless ... Thanks for the explanations :)

@lud lud closed this as completed Mar 4, 2014
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

No branches or pull requests

2 participants