During a recent investigation we had questions whether
Patron is actually keepalive-friendly. It turned out that
it totally is, but there are a few bits which can be
made less tricky than they were. So:
Document connection reuse as it is implemented in Patron
Init the libCURL handle when Session gets created, not lazily
Lazy initialization, although economical, can lead to strange
situations with debugging, and as there already is a lifecycle
we observe (alloc/free via MRI C API) we can just as well init
the libCURL handle there
During a recent investigation we had questions whether Patron is actually keepalive-friendly. It turned out that it totally is, but there are a few bits which can be made less tricky than they were. So:
Lazy initialization, although economical, can lead to strange situations with debugging, and as there already is a lifecycle we observe (alloc/free via MRI C API) we can just as well init the libCURL handle there