✅ Using IProgress with await Task.WhenAll(tasks);
I am trying to introduce a IProgress object into the code below. Can't for the life of me figure how to do it. I need the code this way (rather than via a foreach loop) because I am querying an API which limits the number of concurrent threads.
The IProgress objects main ProgressEventArgs will be how many items have been processed and also the url used in each task instance. Thus I need some way to keep track of how many taks have been completed. Any steers? The code:
3 Replies
i don't know what progress you have to track, but i would say usually you make your class that that implements IProject that keesp the context and bridges the internal call to the event the progress should call
then you pass your class inside your methods down until where it's necessary
and since these are all done by you there should be no barrier to do so
🤦 Coming back to it with fresh eyes - it was simple really:
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View