CachedFeatureStore

class CachedFeatureStore(delegate: FeatureStore, ttl: Duration, timeSource: TimeSource = TimeSource.Monotonic) : FeatureStore(source)

Constructors

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

Functions

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

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(id: String)

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

Link copied to clipboard
Link copied to clipboard
suspend fun FeatureStore.disableGroup(name: String)
Link copied to clipboard
suspend fun FeatureStore.enable(id: String): Feature
Link copied to clipboard
suspend fun FeatureStore.enableGroup(name: String)
Link copied to clipboard
open suspend override fun get(id: String): Feature?
Link copied to clipboard
open suspend override fun getAll(): List<Feature>
Link copied to clipboard
suspend fun FeatureStore.group(name: String): List<Feature>
Link copied to clipboard
open suspend override fun put(feature: Feature)

Inserts or replaces the feature.

Link copied to clipboard
open suspend override fun update(id: String, transform: (Feature) -> Feature): Feature

Atomically replaces the stored feature with the result of transform.