Skip to content

Instantly share code, notes, and snippets.

@dsyme
Created May 20, 2015 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsyme/56cc39dc881aabb904ba to your computer and use it in GitHub Desktop.
Save dsyme/56cc39dc881aabb904ba to your computer and use it in GitHub Desktop.
// assumed
let FindPackages(_,_,_,_) = [| "package" |]
type Source = { IsNuget: bool; Url: string }
let DefaultNugetSource = { IsNuget = true; Url = "http://nuget.org" }
//-------------------------------
// using parallel merged asyncSeq's
let SearchPackagesByName(sources, search) =
let sources = [ yield! sources; yield DefaultNugetSource ]
[ for source in sources ->
asyncSeq { if source.IsNuget then
for p in FindPackages(None, source.Url, search, 1000) do
yield p } ]
|> AsyncSeq.mergeAll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment