Created
May 20, 2015 12:27
-
-
Save dsyme/56cc39dc881aabb904ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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