4 Comments
User's avatar
Alegna's avatar

Does observationTask?.cancel() really cancel the task, given that there is no cancellation check? I mean, maybe we should set it to nil to ensure the cancellation. Thanks!

Expand full comment
JuniperPhoton's avatar

When you await an AsyncSequence, it can really cancel that. For AsyncStream, the continuation's onTermination will be called, and you can do your cleanup here.

Expand full comment
Anton Gubarenko's avatar

Thanks for this info. ObservationTracking in iOS 17 were pretty strange.

Expand full comment
JuniperPhoton's avatar

Yeah, I hope they can really put them in the developers' shoes when writing the documentation.

Expand full comment