Curb gits Forked
Git has really made it much easier to share code. ~23 days after posting curb to github, it now has a fork that’s added direct methods for making a PUT and DELETE request.
Git has really made it much easier to share code. ~23 days after posting curb to github, it now has a fork that’s added direct methods for making a PUT and DELETE request.
Ruby threads require care when writing an extension - especially when the extension does anything over a network. In the case of curb, it’s often used as a replacement to the built in ruby net/http library.
Read more…
I added a new callback hook to curb on_success and on_failure. They work as advertised and are esspecially useful when using the Curl::Multi interface from my last patch.
gc = Curl::Easy.new("http://www.google.com/") gc.on_success{|curl| puts curl.body_str } yc = Curl::Easy.new("http://www.yahoo.com/") yc.on_success{|curl| puts curl.body_str } mc = Curl::Multi.new mc.add(gc) mc.add(yc) mc.perform
I’ve updated my patch for curb multi interface and tested against valgrind for memory leaks. So far the patch looks stable. I’m still waiting to hear from the curb author. In the meantime here’s how to apply the patch if you’re interested.
svn co svn://rubyforge.org/var/svn/curb/TRUNK/curb
wget http://taf2-patches.s3.amazonaws.com/curb-multi.patch
patch -p0 < curb-multi-3.patch
I spent the day working on adding multi interface support to curb. I really like the curb ruby interface and with a little work can now use the same Curb::Easy interface and run the handles through the asynchronous Curb::Multi interface. The patch hasn’t been rigorously tested, but hey not bad for my first day.
Here’s the patch
I started to put together some benchmarks to validate my work on evdispatch. Here’s what I have so far…
Curb as a pure C extension runs on the main ruby thread, meaning no ruby threads can be schedule while it’s blocking. It uses the easy curl interface meaning it’s all blocking. This makes it very easy to use and for single requests it’s great. For multiple requests, it’s as though all the requests are made one after the other in serial.
Read more…
Recent Comments