Reporting download progress with IAsyncEnumerable
Is reporting progress with an
IAsyncEnumerable<T>
weird? I have the following:
Is this a weird thing to do? I know it will "pause" the download in-between each progress yield (that is yield return new DownloadProgress(...)
). But I kind of like the way you consume it:
What are your thoughts?2 Replies
it's a little weird. You don't want logging or UI updates to hamper your downloading
I'd probably do this with a Rx subject. You can probably configure those to invoke observers on a different Task thread
I don't use Rx
I might just use a regular event