Unsubscribe from the Observable.
@JakeWharton rxjava2 only Disposable,but call dispose() cannet cancel request
Yeah that's what I meant. Dispose is hooked up to Call.cancel().
On Thu, Jan 5, 2017 at 10:04 PM ZzjBeatYou notifications@github.com wrote:
@JakeWharton https://github.com/JakeWharton rxjava2 only Disposable,but
call dispose() cannet cancel request—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/square/retrofit/issues/2147#issuecomment-270820378,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEEUiAIQTeb4dZMzf40J7rSCLqWkC-ks5rPa8ngaJpZM4LcWTf
.
thanks
In rxjava2,It could be cancel after using dispose().But I can not subscribe again.
Retrun:HTTP FAILED: java.io.IOException: Canceled.
private final CompositeDisposable disposables;
public void execute(DisposableObserver<T> observer) {
Preconditions.checkNotNull(observer);
final Observable<T> observable = this.buildUseCaseObservable()
.throttleFirst(500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.from(threadExecutor))
.observeOn(postExecutionThread.getScheduler())
.compose(getUseCaseTransformer())
.compose(getCycleTransformer());
addDisposable(observable.subscribeWith(observer));
}
public void dispose() {
if (!disposables.isDisposed()) {
disposables.dispose();
}
}
private void addDisposable(Disposable disposable) {
Preconditions.checkNotNull(disposable);
Preconditions.checkNotNull(disposables);
disposables.add(disposable);
}
I call useCase.execute() and later call useCase.dispose().But I call useCase.execute() again and not thing happened .
Most helpful comment
Unsubscribe from the Observable.