CachedPropertyStore

class CachedPropertyStore(delegate: PropertyStore, ttl: Duration, timeSource: TimeSource = TimeSource.Monotonic) : PropertyStore(source)

Constructors

Link copied to clipboard
constructor(delegate: PropertyStore, ttl: Duration, timeSource: TimeSource = TimeSource.Monotonic)

Functions

Link copied to clipboard
fun PropertyStore.cached(ttl: Duration = 30.seconds, timeSource: TimeSource = TimeSource.Monotonic): PropertyStore

Serves reads from a snapshot of delegate refreshed every ttl; writes go through and drop the snapshot.

Link copied to clipboard
open suspend override fun delete(name: String)

Removes the property; a no-op when it does not exist.

Link copied to clipboard
open suspend override fun get(name: String): Property<Any>?
Link copied to clipboard
open suspend override fun getAll(): List<Property<Any>>
Link copied to clipboard
open suspend override fun put(property: Property<Any>)

Inserts or replaces the property.