Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread Interrupted #25

Open
khaledkhj opened this issue Oct 26, 2017 · 5 comments
Open

Thread Interrupted #25

khaledkhj opened this issue Oct 26, 2017 · 5 comments

Comments

@khaledkhj
Copy link

Any idea how to handle "thread interrupted"?

This happens due to calling the instant search api!

Thank you.

@amitshekhariitbhu
Copy link
Owner

We can handle that by using onErrorResumeNext.

@khaledkhj
Copy link
Author

Thank you for the prompt reply, but can you please show an example on how to use it?

@Apsaliya
Copy link

I tried onErrorResumeNext without any luck. After InterruptedIOException it just won't emit. Looks like some ongoing request's Observable is getting unsubscribed at wrong time. Anyone got any idea?

@Apsaliya
Copy link

Ok, So for those who are still facing this, I managed to solve this by providing a scheduler to my switchMap . So unsubscribe on your previous calls won't affect on your current one.

@SherifMuSherif
Copy link

SherifMuSherif commented Feb 6, 2018

i had same issue "my subscription terminated once an error is emitted",but this one help me

.switchMap(new Func1<String, Observable<Response>>() {
    @Override public Observable<Response> call(String query) {
        return retrofitService.search(query)
                .onErrorResumeNext(Observable.<Response>empty());
    }
})

@khaledkhj @Apsaliya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants