Skip to content
ballmüllersolutions logo Send an email Call us

Lesson 44 of 49about 120 minutes

Module 1.9 · Asynchronous code

Canceling with CancellationToken

What you learn in this lesson

  • explain how canceling works in .NET: CancellationTokenSource gives the signal, CancellationToken carries it on
  • pass a CancellationToken through asynchronous methods and cancel a request with it
  • give a request a time limit with CancellationTokenSource, also through a TimeProvider
  • tell a timeout apart from a cancellation by the caller
  • catch Ctrl+C and end the program cleanly
  • query the Kladde’s holidays with a time limit, so the Kladde keeps working without a network

This lesson belongs to course K1

You will see this lesson's text and video once you have bought the course. The goals above show what you learn here.

€149.00

incl. VAT, one-time payment

Access to all of the course's lessons with their exercises, solutions and videos on this site, for 24 months from the purchase. A self-study course: no tutoring, no exams or grading by us, and no certificate.

Sign in and buy

To course K1

To the overview: K1 Getting started: programming with C#