timcassell / ProtoPromise

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

Add `PromiseEachGroup` #449

Closed timcassell closed 3 months ago

timcassell commented 3 months ago

A structured concurrency group similar to Promise.Each. Disposing the enumerator will cancel the group's token and wait for all operations to complete.

public struct PromiseEachGroup
{
    public PromiseEachGroup Add(Promise promise);

    public AsyncEnumerable<Promise.ResultContainer> GetAsyncEnumerable();
}