Closed guidomedina closed 6 years ago
Very good point. Please see my one single remark. Thank you very much.
Hi @svendiedrichsen what's the remark? I have been looking but I'm clueless, maybe it is a comment you meant to write but haven't?
I'm thinking maybe the lambda function which is generated from the parameter is sub-optimal, I'll see if I can refactor the ValueHandler
so that it is similar to something I did for another project.
My idea is to avoid Lambdas being generated, making the loading function more static, something similar to: https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-core/src/main/java/org/quickfixj/SimpleCache.java
I have added a review comment with the code. You should be able to see it above or when you look at the changed files. Its about using the Map interface instead of the ConcurrentMap interface for the member.
Ah, didn't see it, I will fix tomorrow, I might redo that part in a better way, I'll get back to you tomorrow when I'm back at work.
OK, I managed to fix it from home.
Avoid locking and use
ConcurrentHashMap.computeIfAbsent(...)
combination in the Cache.