Skip to content

Commit 7eb09b4

Browse files
chore: add link pointers to ConcurrentConsumingTaskCollection.cs
1 parent b5122f8 commit 7eb09b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/WouterVanRanst.Utils/Collections/ConcurrentConsumingTaskCollection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace WouterVanRanst.Utils.Collections;
1111
/// <typeparam name="T">The type of the result returned by the tasks.</typeparam>
1212
public sealed class ConcurrentConsumingTaskCollection<T>
1313
{
14+
/* TODO: See for a better approach https://devblogs.microsoft.com/pfxteam/processing-tasks-as-they-complete/, https://github.com/StephenCleary/AsyncEx/blob/0361015459938f2eb8f3c1ad1021d19ee01c93a4/src/Nito.AsyncEx.Tasks/TaskExtensions.cs#L184
15+
*/
1416
private readonly Channel<Task<T>> channel = Channel.CreateUnbounded<Task<T>>(new UnboundedChannelOptions { AllowSynchronousContinuations = false, SingleReader = false, SingleWriter = false });
1517

1618
private bool addingCompleted = false;
@@ -52,4 +54,4 @@ public async IAsyncEnumerable<Task<T>> GetConsumingEnumerable([EnumeratorCancell
5254
await foreach (var t in channel.Reader.ReadAllAsync(cancellationToken))
5355
yield return t;
5456
}
55-
}
57+
}

0 commit comments

Comments
 (0)