Builder

Collects the properties of a CaffeineResponseCache. Not thread-safe; use it only inside the factory's lambda. Stable Core.

Properties

Link copied to clipboard
var loadDispatcher: CoroutineDispatcher

Where loads run. Dispatchers.Default by default. It should dispatch: an unconfined dispatcher runs a load's first segment on the calling thread.

Link copied to clipboard

Where Caffeine's maintenance runs. ForkJoinPool.commonPool by default. The cache never shuts it down, and it must outlive the cache's last write.

Link copied to clipboard

The bound on the total weight of stored entries: each Found weighs what it reports (1 by default), each Missing weighs 1. At least 1. DEFAULT_MAX_WEIGHT by default.

Link copied to clipboard

The clock of every age and lifetime; one mark is taken at construction. TimeSource.Monotonic by default. A source that is not monotonic can lengthen lifetimes; ages are clamped at zero.