I'm using an RxJava ReplaySubject in my Fragment.
I'm attempting to use the ReplaySubject in a way, where I would like the Subject to execute a process until completion (possibly beyond the life of the fragment).
On completion of the process, I would like to release the resources which -as i understand- is done by unsubscribing the subscription at the time of registering the observer (which in my case, is the subject itself).
In this github issue thread @benjchristensen says:
If it is an Observable then it should emit an onCompleted and be done.
If it is an Observer then it should unsubscribe from the Subscription it received when it called Observable.subscribe and it will give the Observable a chance to shutdown and clean up.
If it's a Subject -which is both an Observer and an Observable- what is the behavior? If i call onComplete on the subject, does that basically mean the subscription is stopped, and I am therefore relieved of needing to manually unsubscribe the subscription i get by registering the observer?