kernelsauce / turbo

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
http://turbo.readthedocs.io/
Apache License 2.0
528 stars 84 forks source link

Persistent HTTPClient connections #264

Closed wranai closed 8 years ago

wranai commented 8 years ago

I can see there already is a keep_alive flag for fetch(), which keeps the iostream open upon finalization. If I set in_progress to false, I can do another fetch and it works, but it does so by opening a new connection first, even if was kept alive and could be re-used; it's rather wasteful, especially for HTTPS. I need to connect to only one server, and I think it's not unusual that we just need to access one or two APIs, so being able to re-use the connection would be very useful.

kernelsauce commented 8 years ago

Hi. Yes that is a drawback indeed. However theres not much work to do to make it use persistent connections... I can not say when I get the time to implement it though.

kernelsauce commented 8 years ago

By setting the keep-alive flag you should now be able to reuse connection for http and https :).