Hi
I have java code like this to fetch bulk of documents by their keys
private final Bucket bucket;
public Collection<MyDocument> getAndTouch(List<String> keys) {
return Observable.from(keys).flatMap(
key -> bucket.async()
.getAndTouch(key, 0, RawJsonDocument.class)
.map(this::parseJsonDocument))
.subscribeOn(Schedulers.io()) /*DOES IT MAKE ANY SENCE*/
.toList().toBlocking().single();
}
I expect such calls for collections of up to 1oK keys. Since we don’t do computations here but rather IOs I wonder does it make sense to subscribe on IO scheduler. Will it have much impact on performance?
Examples I saw before don’t do this, but I don’t understand why