help
Root Question Message
IAsyncEnumerable<T>
weird? I have the following:public interface IDownloadService
{
IAsyncEnumerable<DownloadProgress> DownloadAsync(CancellationToken cancellationToken = default);
}
yield return new DownloadProgress(...)
). But I kind of like the way you consume it:var enumerable = _downloadService.DownloadAsync(cancellationToken);
await foreach (var progress in enumerable.WithCancellation(cancellationToken))
{
// Use 'progress' here...
}