Chapter 4: Exception handling and cancellation
In this chapter
- How
awaithandles exceptions- Beware of the fire-and-forget trap
- The role of
AggregateExceptionTask.WhenAlland multiple exceptions
- Canceling tasks gracefully
- Requesting cancellation
- Listening for cancellation and passing the token through
- Registering cancellation callbacks
- A non-cancelable token
- Implementing timeouts
- Testable timeout logic with
TimeProvider(.NET 8+)
- Testable timeout logic with
- Summary
This chapter is not available in the free preview. Purchase the book to read the complete edition now.