Archive

Posts Tagged ‘Curb’

Curb gits Forked

August 25th, 2008

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.

Software , ,

Adding ruby thread scheduling to curb

August 4th, 2008

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…

Software , ,

curb to github

July 15th, 2008

I’ve made a few more improvements to curb and decided keeping track of all these patches is too much. I’m now tracking my changes on github, and hopefully the curb author will reappear to review the changes soon, so we can get them released in gem form.

Software ,

New curb patch, on_success, and on_failure

July 10th, 2008

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

Read more…

Software , ,

Updated curb multi interface patch

July 3rd, 2008

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.

Check out curb trunk

svn co svn://rubyforge.org/var/svn/curb/TRUNK/curb

Grab my latest patch

wget http://taf2-patches.s3.amazonaws.com/curb-multi.patch

Apply the patch

patch -p0 < curb-multi-3.patch

Read more…

Software , ,

curb meet multi interface

July 2nd, 2008

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

Software , ,

benchmarking curb/net::http/evdispatch

June 4th, 2008

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…

Software , , , ,