Scala mass URL download
Question: I've recently taken an interest in learning Scala (mostly working through
Project Euler at the moment), and I've decided on a simple program I want to
write: A simple concurrent downloader. I'm having some difficulty wrapping my
head around a good way to do it.

I know Python well, and I like the way the gevent library works. What I'd like
to do is solved with gevent [here](http://www.youtube.com/watch?v=UcKqyn-gUbY
"gevent example"). Is there a simple way to do something like this in Scala,
or am I totally heading down the wrong path? I've looked at the Dispatch
library, but it seems incomprehensible. Should I be using Actors?

Any help or guidance would be appreciated. Thanks.


Answer: Ok, I do agree that [Dispatch](http://dispatch.databinder.net/Dispatch.html)
documentation is a bit rough and small at the moment, but that'll probably
change in the future (and it is the situation with many great Scala libs).

But the result of applying Dispatch for your need is spectacular:

    
    
    import dispatch._
    (1 to 100).map{ i => 
       Http(url("http://bash.org/?" + i) OK as.String) 
    }.map{ f => 
      try {Some(f.apply)} catch {case e => println(e.getMessage); None}
    }.seq.flatten
    

This would get you files for first 100 quotes from `bash.org`, in parallel.

