CachedFactory
mill.util.CachedFactory
@Scaladoc(value = "/**\n * Manage the setup, teardown, and caching of objects of type [[V]] safely\n * in a multithreaded environment.\n *\n * The user provides the [[setup]] and [[teardown]] logic along with a [[maxCacheSize]],\n * and [[CachedFactory]] provides instances of [[V]] as requested using the [[withValue]]\n * method. These instances are automatically constructed on-demand from the give key,\n * cached with an LRU strategy, and destroyed when they are eventually evicted\n *\n * Intended for relatively small caches approximately O(num-threads) in size that\n * will typically get used in a build system, not intended for caching large amounts of entries\n */")
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
Members list
In this article