On Thu, May 13, 2010 at 1:37 AM, Daniel DeLorme <dan-ml / dan42.com> 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("<content goes here>", website.value)
>

Looks like you want futures, which can be provided by any number of
frameworks.  A pretty awesome one to consider is dataflow, which is based
off ideas from the Oz language:

http://github.com/larrytheliquid/dataflow

MenTaLguY's Omnibus library also provides futures, however I don't believe
it's presently maintained:

http://rubyforge.org/projects/concurrent

-- 
Tony Arcieri
Medioh! A Kudelski Brand