Not sure the preferred way to handle this. I created a local function so I could share the lock object rather than adding it as a class variable. If you are using .NET 6+ it allows the use of Parallel.ForEachAsync. Because of using Parallel.ForEachAsync I also added a lock for updating the main list. Unsure if there are complications of allowing this to query a server multiple times at once (also with no upper bound set).
I am also unsure if this should be littered with .ConfigureAwait(false) for all those tasks it is using.
I have not run any of the tests to confirm these changes work, but this is copy/pasted where I am using it for an internal tool I am testing out.
Fixes
Issue #55
Description
Not sure the preferred way to handle this. I created a local function so I could share the lock object rather than adding it as a class variable. If you are using .NET 6+ it allows the use of
Parallel.ForEachAsync
. Because of usingParallel.ForEachAsync
I also added a lock for updating the main list. Unsure if there are complications of allowing this to query a server multiple times at once (also with no upper bound set).I am also unsure if this should be littered with
.ConfigureAwait(false)
for all those tasks it is using.I have not run any of the tests to confirm these changes work, but this is copy/pasted where I am using it for an internal tool I am testing out.