timcassell / ProtoPromise

Robust and efficient library for management of asynchronous operations in C#/.Net.
MIT License
136 stars 13 forks source link

Add `Promise.Each` to process operations as they complete #421

Closed timcassell closed 2 weeks ago

timcassell commented 3 months ago

Similar to new Task.WhenEach.

TPL uses WhenAll WhenAny WhenEach APIs, while ProtoPromise uses All Race, so it follows to use Each for this rather than WhenEach.

Also, instead of returning IAsyncEnumerable<Task<T>>, we can return AsyncEnumerable<Promise<T>.ResultContainer>.