Skip to content

Instantly share code, notes, and snippets.

@lepoetemaudit
Last active August 29, 2015 14:27
Show Gist options
  • Save lepoetemaudit/52c35ab8d4d1931ba06c to your computer and use it in GitHub Desktop.
Save lepoetemaudit/52c35ab8d4d1931ba06c to your computer and use it in GitHub Desktop.
F# Async.Parallel
open FSharp.Data
open System.Threading
["http://bbc.co.uk"; "http://www.google.co.uk"]
|> List.map (fun str ->
async {
let! html = Http.AsyncRequestString(str)
return sprintf "bbc len %d" html.Length
}
)
|> Async.Parallel
|> Async.RunSynchronously
|> String.concat ", "
|> printfn "Lengths are: %s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment