mill.util.RefCountedCache
See theRefCountedCache companion object
class RefCountedCache[Key, InternalKey, InitData, Value](convertKey: Key => InternalKey, setup: (Key, InternalKey, InitData) => Value, closeValue: Value => Unit) extends AutoCloseable
Generic reference counted cache, where values are created on-demand and closed when no more references exist.
Provides a public API that uses Key, but transforms it to InternalKey for caching, usually for performance reasons.
Type parameters
- InitData
-
transient initialization data that will be passed to setup
Attributes
- Companion
- object
- Source
- RefCountedCache.scala
- Graph
-
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Members list
In this article