No option for ConcatMap with skip error
Version : RxJava1
Consider this example: I have a file downloading in sequence. If one download fails, it should move to next. Psudo code:
Observable.from(urls)
.concatMap(url -> downloadObservable(url))
There is no option for moving to next url if the download fails.
There is no way to skip with onErrorResumeNext() as I just want to move to next url.
Please make sure you have the latest 1.x version and check the available operators again.
@akarnokd I have latest version 1.x. No offense, but the docs are like explaining rocket science. Can you just hint the operator?
What's in the suggestion list when you start typing .concatMap in your IDE?
concatMapEager and concatMapDelayError are there. I think concatMapDelayError would work. But that isn't mentioned clearly in docs that it will switch next. Also, I need the count of failed items, can I use doOnError for that after concatMapDelayError ?
But that isn't mentioned clearly in docs that it will switch next.
That would be logically contradictory, no? Why have a delayError operator when it just stops after the first error. Also the JavaDoc is pretty clear IMO:
"Maps each of the items into an Observable, subscribes to them one after the other, one at a time and emits their values in order while delaying any error from either this or any of the inner Observables till all of them terminate."
Also, I need the count of failed items, can I use doOnError for that after concatMapDelayError?
No. There is only at most one call to onError after concatMapDelayError which in this case could be a single arbitrary Throwable or a CompositeException for more than one failing source.
But I don't want to stop after first error. I want to move to next url in concatMap.
I'm facing the same problem. I have handled the error correctly, but I need to continue with the next observable.
@mattid89 how did you solve this?