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

Single.onErrorResumeNext #3440

Closed
TastyPi opened this issue Oct 13, 2015 · 5 comments
Closed

Single.onErrorResumeNext #3440

TastyPi opened this issue Oct 13, 2015 · 5 comments

Comments

@TastyPi
Copy link

TastyPi commented Oct 13, 2015

Observable has a onErrorResumeNext to continue with a new Observable if onError is called. I'd like something similar for Single, so:

Single<T> onErrorResumeNext(Single<? extends T> resumeSingle)

Single<T> onErrorResumeNext(Func1<? super Throwable, ? extends Single<? extends T>> resumeFunction)

Single already has onErrorReturn, it makes sense to have onErrorResumeNext as well.

@adennie
Copy link

adennie commented Oct 13, 2015

@artem-zinnatullin
Copy link
Contributor

I'll work on this.

@artem-zinnatullin
Copy link
Contributor

@akarnokd I can do it in 2 ways:

  1. Convert Single to Observable and lift already implemented and tested OperatorOnErrorResumeNextViaFunction and OperatorOnErrorResumeNextViaObservable.
  2. Re-implement these operators for Single, it may give some performance boost, but adds two classes to the library.

I guess you'll vote for 2nd way, but I think it worth to ask :)

@akarnokd
Copy link
Member

Frankly, I'm not satisfied with 1.x Single and how it tries to reuse Observable components; it leads to wrappers and un-wrappers and so on even for the trivial operators. If they were retryWhen then I'd say convert back and forth like I do with 2.x. So yes, I vote for option 2.

@artem-zinnatullin
Copy link
Contributor

ok, no problem :)

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

No branches or pull requests

4 participants