Closed bos closed 13 years ago
This is definitely a feature I have been planning on adding. Do you have any ideas of what an API for this might look like? I have some ideas that would involve running everything within a special monad, but I would overall prefer a light-weight approach.
I think maybe just having a Manager value that you pass in, where any possible kept-alive connections would be managed, should be just fine. This would allow separate managers for different threads, for instance.
using a manager value would make the streaming api ghc7 specific isn't it ? that would be a bit unfortunate since ghc7 is not yet the "default" ghc.
I took the "Manager" value to just be something like:
newtype Manager = Manager (MVar (Map (Host, Port, IsSecure) Socket))
Did you mean something different Bryan? Overall this seems fine, though I'm not quite certain how it will play out with https connection due to handshake issues, I'll still need to look into that.
I did indeed mean exactly what you suggest, Michael. Thanks for clarifying :-)
I have a client that needs to hit a single server:port with a lot of POST requests, and I'm running out of sockets very rapidly because http-enumerator lacks keepalive support.