[Haskell-cafe] using the orc library

Edward Z. Yang ezyang at MIT.EDU
Fri Jul 30 18:16:43 EDT 2010


Excerpts from Günther Schmidt's message of Fri Jul 30 16:16:38 -0400 2010:
> I'd like to download 1,000 web pages with up to 6 six concurrent 
> downloads at a time.
> 
> How can I express such a thread limit within the orc EDSL?

One solution that comes to mind is place all 1000 web pages in an MVar
containing a queue of URLs to process (a list will probably suffice),
and then use Orc to orchestrate six threads that pull a page from the queue
and make a download.  Admittedly, Orc doesn't buy you very much in this
scenario until you add timeout handling and such.

Cheers,
Edward


More information about the Haskell-Cafe mailing list