Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 1 Β· Quiz
Async/Await Done Right
1. What is the primary purpose of using `async`/`await` in web servers?
To make requests faster
To release the thread during wait
To improve database performance
To handle more requests simultaneously
2. What does the cardinal rule 'async all the way down' imply?
Only the controller needs to be async
Only the data layer needs to be async
All layers of the application must implement async
Async methods may mix with synchronous ones
3. Why should `async void` be avoided outside of event handlers?
It's faster than `async Task`
It leads to unhandled exceptions
It does not support cancellation
It is required by MVC
4. What is the benefit of using a `CancellationToken` in async methods?
It speeds up execution
It prevents thread blocking
It allows cancellation of unnecessary work
It improves error handling
Submit answers
Continue: Exceptions, Logging, and DI β
Review this lesson
Retake quiz