7 C# Async operations
This chapter covers
- Learning the technology behind Asynchronous programs
- Developing code to work asynchronously
- Comparing values through the use of pattern matching
- Using Records to define classes
- Developing a timed "Diffuse the bomb" math project
Welcome to chapter 7, and welcome to the first big challenge. While the previous file system chapter included the first official advanced project, it was just the introduction to the second part of this book. With this chapter, we enter the world of Asynchronous programming. If we have ever heard about await and async, we have successfully encountered an asynchronous program in its natural habitat. However, if we are not yet familiar with these, we will not know what we could do with them or what advantages they offer. So, it is for that, that this chapter exists.
In this chapter's project, we will use async operations and pattern matching to develop a project that will prompt the user with a timed, randomly generated math question. Using asynchronous operations, we will be able to run a timer while simultaneously running our main logic throughout the entire process, from prompting the question to receiving the answer and comparing results.