how to stop an running function or subject.
I have written an subject which when executed takes some time to finish. i have also placed an cancel button to cancel the executed of the subject.

So i wanted to know how to cancel the execution of the subject in the middle and release the resources used.