News for hackers. Stuff that matters.
Re:Asynchronous Programming in C# by Matthias247 on Saturday September 25, 2021 @01:23AM (#28650738)
I think it made sense for UI integrations. From a synchronous OnClick delegate you could start an async void function - which essentially starts a background task that lives even after the click handler returns. Returning a Task here would not have made sense since nothing awaits it. But arguably the use-case could also have been fulfilled by calling `Task.Run` in the handler to spawn a background task.
Re:Asynchronous Programming in C# by sebazzz on Saturday September 25, 2021 @02:36AM (#28651003)
Without knowing what the underlying method does, the async method may block the UI thread because until the first await which doesn't immediately continue it runs on the UI thread.