Skip to content

Create a different way of using async/await in the AsyncAwait solution #4

@marijnz0r

Description

@marijnz0r

First of all I want to thank you for your work invested in this project and creating examples for the community. It has helped me a lot.
I want to suggest an improvement to the AsyncAwait solution.
Currently the only usage of the task-based asynchronous pattern is using a different thread to do work on. I think we can improve the solution by providing an example that uses the async and await keywords without introducing a new thread.

Current way:
await Task.Run(() => bst.MakeBreakfast());

Alternative way:
await bst.MakeBreakfastAsync();

This has the same result: work being done asynchronously and a responsive UI, but without an extra thread.

It requires a certain amount of extra code, but I would love to contribute to the project. Let me know if you would appreciate this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions