Best practice is to mark function async void
only if it is fire and forget method, if you want to await on, you should mark it as async Task
.
In case if you still want to await, then wrap it like so await Task.Run(() => blah())
More Related Contents:
- What is the difference between asynchronous programming and multithreading?
- Catch an exception thrown by an async void method
- Should I avoid ‘async void’ event handlers?
- Fire and forget async method in asp.net mvc
- Why File.ReadAllLinesAsync() blocks the UI thread?
- Fire-and-forget with async vs “old async delegate”
- How can I call an async method in Main?
- Order of event handler execution
- How to protect resources that may be used in a multi-threaded or async environment?
- How to run and interact with an async Task from a WPF gui
- Using async without await
- Best way to convert callback-based async method to awaitable task
- Asynchronously sending Emails in C#?
- How does async works in C#?
- Broken TCP messages
- Can a TCP c# client receive and send continuously/consecutively without sleep?
- Async/Await – is it *concurrent*?
- Why does asynchronous delegate method require calling EndInvoke?
- Are you there, asynchronously written value?
- What happens while waiting on a Task’s Result?
- Asynchronous iterator Task
- Async always WaitingForActivation
- How can I use async to increase WinForms performance?
- Horrible performance using SqlCommand Async methods with large data
- How to throttle multiple asynchronous tasks?
- BeginInvoke not supported on .NET core? (PlatformNotSupported exception)
- Using async / await with DataReader ? ( without middle buffers!)
- Pause and Resume Subscription on cold IObservable
- Sessions in Asynchronous design
- Timeout pattern on task-based asynchronous method in C#