dotnet / reactive

The Reactive Extensions for .NET
http://reactivex.io
MIT License
6.74k stars 751 forks source link

Retain cancel callback until ForEachAsync completes #1981

Closed idg10 closed 1 year ago

idg10 commented 1 year ago

Resolves #1940

The code that waits for processing to complete was after the closing brace of the using that unregisters the cancellation callback. This meant that it almost immediately unregistered for cancellation notifications. Simply moving that await inside the relevant block addresses this.