ConversionCache

class ConversionCache(store: FileStore, maxEntries: Int = 500, logger: Logger) : StoppableService(source)

Constructors

Link copied to clipboard
constructor(store: FileStore, maxEntries: Int = 500, logger: Logger)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun get(key: String): String?

Retrieves a cached conversion result by key.

Link copied to clipboard

Loads the conversion cache from disk into memory. If the cache file does not exist or version is incompatible, initializes it with an empty cache.

Link copied to clipboard
fun put(key: String, value: String)

Stores a conversion result in the cache.

Link copied to clipboard

Writes the cache to disk if anything changed since the last write.

Link copied to clipboard
open override fun stop()

Flushes on the shutdown path; the periodic task calls saveToDisk directly.