I run into problem when creating Observable with:
Observable.create(new ObservableOnSubscribe())
When new ObservableOnSubscribe implements Disposable it is expected to call dispose() method to release some resources, that is not happening.
Observable created with Observable.create(..) doesn't implement Disposable and the upstream clean up isn't passing through to ObservableOnSubscribe.
I am open to discussion and suggest small change with:
Observable.java add method:
public static <T> Observable<T> createDisposable(DisposableObservableOnSubscribe<T> observableOnSubscribe) {
return Observable.create(observableOnSubscribe).doOnDispose(observableOnSubscribe::dispose);
}
with adding new Interface of DisposableObservableOnSubscribe:
public interface DisposableObservableOnSubscribe<T> extends ObservableOnSubscribe<T>, Disposable {
}
Or doing it other way - like I did on: gist
I didn't found something that would solve this use case.
I run into problem when creating Observable with:
Observable.create(new ObservableOnSubscribe())When new
ObservableOnSubscribeimplementsDisposableit is expected to calldispose()method to release some resources, that is not happening.Observablecreated withObservable.create(..)doesn't implementDisposableand the upstream clean up isn't passing through toObservableOnSubscribe.I am open to discussion and suggest small change with:
Observable.java add method:
with adding new Interface of
DisposableObservableOnSubscribe:Or doing it other way - like I did on: gist
I didn't found something that would solve this use case.