Skip to content
This repository

keep-alive connections (feature request?) #44

Closed
prettynatty opened this Issue · 4 comments

2 participants

Andrey Kouznetsov Julien Kirch
Andrey Kouznetsov

Hello.
I have a problem described here: http://github.com/couchrest/couchrest/issues#issue/43
Couchrest is using rest-client.
It would be great if the library wouldn't create new connection per every request.
So this is possible without using hard socket api. May be it is useful to use Mechanize(without nokogiri) for requests?

Julien Kirch
Owner

From what I read on keep alive, wouldn't reusing the same connection prevent the library to be multithreaded ?

Andrey Kouznetsov

If I correctly understood your question, yes if the library use keep-alive connections it is not thread-safe(without some cheats). But this problem may be solved by reconnecting if socket is closed. Anyway mechanize can do it by itself.
*sorry for my english.

Julien Kirch
Owner

So I think I prefer to keep rest-client simple (mechnize is a big dependency) and thread-safe so to not support keep-alive, but you could perhaps do it with restclient-components http://github.com/crohr/rest-client-components

Andrey Kouznetsov

hmm it is good idea.
when I find time I'll implement this in my fork of rest-client-components.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.