Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    I would make it a async Task not a asnyc void so you could do await RunBusyTask(() => {...});. Asnyc void should only be used to make your method signature be compatible with a event handler. Commented Jan 29, 2016 at 20:48
  • @ScottChamberlain Good point, it's usually better to return Task, unless you need the method for an event.
    – IS4
    Commented Jan 29, 2016 at 20:49
  • 1
    You should really just accept a Task, or a Func<Task>, because the task may not represent CPU bound work.
    – Servy
    Commented Jan 29, 2016 at 21:04