Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not show AsyncConverter.AsyncWait error on finished tasks #116

Open
DawidIzydor opened this issue Oct 9, 2020 · 0 comments
Open

Do not show AsyncConverter.AsyncWait error on finished tasks #116

DawidIzydor opened this issue Oct 9, 2020 · 0 comments

Comments

@DawidIzydor
Copy link

In a scenario, where one has multiple Tasks and wants to put some logic to run after any task is finished (ie. progress reporting) Exceptional shows unnecesary error.

Example code

List<Task<string>> tasks = CreateSomeTasks();
while(tasks.Any())
{
    var finished = await Task.WhenAny(tasks);
    tasks.Remove(finished);
    DoSomethingWith(finished.Result);
}

On the last lane there will be error that the code synchronizacly waits for async operation, when the task is already finished so no waiting occur.

The easiest way other than to disable once, would be to have a smart surpresion - ie. if "finished" key word is used in the name it defaults to Warning instead of Error and the severity could be separatly configured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant