Hi guys,
I want to download a file from several possible locations. Each location has three possible results:
- error (e.g. a timeout, 404)
- success with a new file (200)
- not modified (304)
My (pseudo) code so far:
Flowable.just(url1, url2...)
.parallel()
.runOn(Schedulers.computation())
.map( ...http download )
.filter( ... status code == 200 )
.map( ... parse content ...)
.reduce( ..find newest file..)
My problem: I can not differentiate between errors and not modified.
What I would like as result:
A Maybe<File> that gives me the following calls:
- onError: if *all* urls have failed
- onNext: if at least one url has returned 200
- onComplete: if at least one url has *not* returned an error
Is this possible?
Thanks,
Johannes