Click here to Skip to main content
15,888,401 members
Articles / Programming Languages / C#

Adapting Event and Callback Based Asynchronicity to the Task Framework

Rate me:
Please Sign up or sign in to vote.
4.43/5 (7 votes)
19 Feb 2021MIT7 min read 7.5K   73   3  
Use TaskCompletionSource to turn an event or callback based model into a Task based one
There are many ways to skin an asynchronous cat. We're going to adapt an event based model to a newer Task based model using the TaskCompletionSource object and just a little bit of witchcraft.

Views

Daily Counts

Downloads

Weekly Counts

License

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


Written By
United States United States
Just a shiny lil monster. Casts spells in C++. Mostly harmless.

Comments and Discussions