The Task Cancellation Trap

Working with cancellation in tasks is a double-edged sword. It&#x2019;s great when it works, but it&#x2019;s so easy to shoot yourself in the foot. Take the observerTask example from the previous post : let observerTask = Task { let notifications = NotificationCenter.default.notifications(named: name) for await next in