From: Zach Moazeni Date: 2010-05-18T12:17:19+09:00 Subject: Re: Asynchronous HTTP request You could check out http://github.com/pauldix/typhoeus It allows you to create parallel HTTP requests pretty easily. On May 13, 2010, at 3:37 AM, Daniel DeLorme wrote: > Does anyone know how to do the following, but without threads, purely with asynchronous IO? > > website = Thread.new{ Net::HTTP.get(URI.parse(url)) } > template = compute_lots_of_stuff() > puts template.sub("", website.value) > > I'm not sure I understand EventMachine, but it doesn't seem like this code fits with the "event loop" model. Besides, I don't want to react to every chunk of data that comes it; I just want the result at the end. > > Thanks. > -- Zach Moazeni http://simplechatter.com