Esempio n. 1
0
        public void Parallel()
        {
            var urls = FSharpList.Create(
                "http://www.google.com"
                , "http://www.bing.com"
                , "http://www.yahoo.com"
                , "http://www.microsoft.com"
                );
            var result = FSharpAsync.Parallel(urls.Select(Get)).Select(s => string.Join("", s)).Run();
            var rx     = new Regex(@"<html");

            Assert.AreEqual(4, rx.Matches(result).Count);
        }
Esempio n. 2
0
 public static Task <R[]> Parallel <R>(IEnumerable <Task <R> > computations) =>
 FSharpAsync.StartAsTask(FSharpAsync.Parallel <R>(computations.Select(FSharpAsync.AwaitTask)), FSharpOption <TaskCreationOptions> .None, FSharpOption <System.Threading.CancellationToken> .None);
Esempio n. 3
0
 public static FSharpAsync <R[]> Parallel <R>(IEnumerable <FSharpAsync <R> > computations) => FSharpAsync.Parallel <R>(computations);