Currently TypeResolver uses simple LRU-cache, built on LinkedHashMap.
While that works fine for many use cases there may be cases where highly concurrent, high call rate may lead to concurrency issues (see #40).
Since caching should be easy to make pluggable, let's allow passing of alternate cache implementations for TypeResolver.
In addition to extracting current LRU-based implementation as LRUTypeCache (implementing ResolvedTypeCache which becomes abstract base class), let's also implement simple ConcurrentHashMap-based alternative, ConcurrentTypeCache.
Currently
TypeResolver
uses simple LRU-cache, built onLinkedHashMap
. While that works fine for many use cases there may be cases where highly concurrent, high call rate may lead to concurrency issues (see #40). Since caching should be easy to make pluggable, let's allow passing of alternate cache implementations forTypeResolver
.In addition to extracting current LRU-based implementation as
LRUTypeCache
(implementingResolvedTypeCache
which becomes abstract base class), let's also implement simpleConcurrentHashMap
-based alternative,ConcurrentTypeCache
.