Click here to Skip to main content
14,668,412 members
Articles » Platforms, Frameworks & Libraries » .NET Framework » How To » Revisions


41 bookmarked

How to Use the C# Await Keyword on Anything

Rate this:
4.91 (27 votes)
Please Sign up or sign in to vote.
4.91 (27 votes)
24 Jul 2020MIT
Using await in scenarios where you want to await custom items with or without using Task.Run()
Await can be used on things other than Task objects - it's simply a matter of implementing the members the compiler wants. Here, I endeavor to explain how to await anything using custom awaitable objects and also using TaskAwaiter.



Compare Revision Minor Date Status Editor
10 - publicly available Yes 25-Jul-20 16:29 Available honey the codewitch
Updates in content. Changes: 11
2 No 24-Jul-20 13:30 Available honey the codewitch
Updates in content. Changes: 3746


This article, along with any associated source code and files, is licensed under The MIT License


About the Author

honey the codewitch
United States United States
Just a shiny lil monster. Casts spells in C++. Mostly harmless.

Comments and Discussions