CachedFactory
mill.util.CachedFactory
abstract class CachedFactory[K, V] extends AutoCloseable
Manage the setup, teardown, and caching of objects of type V safely in a multithreaded environment.
The user provides the setup and teardown logic along with a maxCacheSize, and CachedFactory provides instances of V as requested using the withValue method. These instances are automatically constructed on-demand from the give key, cached with an LRU strategy, and destroyed when they are eventually evicted
Intended for relatively small caches approximately O(num-threads) in size that will typically get used in a build system, not intended for caching large amounts of entries
Attributes
- Source
- CachedFactory.scala
- Graph
-
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
- Known subtypes
-
class ClassLoaderCachedFactory[T]class KotlinWorkerManager
Members list
In this article