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
internal static class AsyncHelper | |
{ | |
public static Task ForEachAsync<T>(this IEnumerable<T> source, int dop, Func<T, Task> body) | |
{ | |
return Task.WhenAll( | |
Partitioner.Create(source) | |
.GetPartitions(dop) | |
.Select(partition => Task.Run(async delegate | |
{ | |
using (partition) |
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
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System.Net.Http; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading.Tasks; | |
using System.Text; |
OlderNewer