fsprojects / FSharp.Control.Reactive

Extensions and wrappers for using Reactive Extensions (Rx) with F#.
http://fsprojects.github.io/FSharp.Control.Reactive
Other
284 stars 58 forks source link

switchAsync and switchTask do not respect cancellation #154

Closed deviousasti closed 3 years ago

deviousasti commented 3 years ago

This is similar to #137.

The expected behavior of the switch operator is to dispose the subscription to the previously projected observable - this is part of what makes switch very useful.

We're not passing in the cancellation token, so switchAsync ends up running the async in the background even though the subscription is lost. We should probably fix this to make it so that switchAsync and switchTask behaves like map followed by a switch.

deviousasti commented 3 years ago

@panesofglass Shall I push a PR for this?

panesofglass commented 3 years ago

@deviousasti please do, if you have the time!

panesofglass commented 3 years ago

By the way, would you like to become a contributor? You have made several excellent contributions, and I'd love to remove any blockers to you getting more fixes into the library.

deviousasti commented 3 years ago

Yes, I'd love to. Thank you for the vote of confidence. I spoke to Mathias from FSSF, and was invited to collaborate on this repo.

I hope to keep improving this library, and responding to issues. I look forward to working with you. :)