Does Google Guava Cache load the cache on the same thread by default?
Code:
cache = CacheBuilder
.newBuilder()
.refreshAfterWrite(2, TimeUnit.SECONDS)
.build(new CacheLoader<String,String>() {
@Override
public String load(String s) throws Exception {
return addCache(s);
}
});
Will the call to addCache
be made on a different thread? As far as I know, it is a synchronous call but I am not sure.