From 315a7cb29e41db7df0fa23b4f5ba9d2eeaa483f5 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 25 Apr 2023 17:23:47 +0600 Subject: [PATCH] Rename full caching factories functions to fullyCached --- CHANGELOG.md | 3 +++ .../micro_utils/repos/cache/full/FullCRUDCacheRepo.kt | 9 ++++++++- .../repos/cache/full/FullKeyValueCacheRepo.kt | 8 +++++++- .../repos/cache/full/FullKeyValuesCacheRepo.kt | 6 ++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e195ed81c18..60a3ef5c9c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ * `Ktor`: * `Server`: * Now it is possible to take query parameters as list +* `Repos`: + * `Cache`: + * Rename full caching factories functions to `fullyCached` ## 0.17.8 diff --git a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullCRUDCacheRepo.kt b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullCRUDCacheRepo.kt index 7d8c236c6ad..080a5a00a46 100644 --- a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullCRUDCacheRepo.kt +++ b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullCRUDCacheRepo.kt @@ -102,8 +102,15 @@ open class FullCRUDCacheRepo( } } -fun CRUDRepo.cached( +fun CRUDRepo.fullyCached( kvCache: FullKVCache, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), idGetter: (ObjectType) -> IdType ) = FullCRUDCacheRepo(this, kvCache, scope, idGetter) + +@Deprecated("Renamed", ReplaceWith("this.fullyCached(kvCache, scope, idGetter)", "dev.inmo.micro_utils.repos.cache.full.fullyCached")) +fun CRUDRepo.cached( + kvCache: FullKVCache, + scope: CoroutineScope = CoroutineScope(Dispatchers.Default), + idGetter: (ObjectType) -> IdType +) = fullyCached(kvCache, scope, idGetter) diff --git a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValueCacheRepo.kt b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValueCacheRepo.kt index 8a985d017be..4b976b75e29 100644 --- a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValueCacheRepo.kt +++ b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValueCacheRepo.kt @@ -117,7 +117,13 @@ open class FullKeyValueCacheRepo( } } -fun KeyValueRepo.cached( +fun KeyValueRepo.fullyCached( kvCache: FullKVCache, scope: CoroutineScope = CoroutineScope(Dispatchers.Default) ) = FullKeyValueCacheRepo(this, kvCache, scope) + +@Deprecated("Renamed", ReplaceWith("this.fullyCached(kvCache, scope)", "dev.inmo.micro_utils.repos.cache.full.fullyCached")) +fun KeyValueRepo.cached( + kvCache: FullKVCache, + scope: CoroutineScope = CoroutineScope(Dispatchers.Default) +) = fullyCached(kvCache, scope) diff --git a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValuesCacheRepo.kt b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValuesCacheRepo.kt index fc4bf34db0b..ae2e6be1cf0 100644 --- a/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValuesCacheRepo.kt +++ b/repos/cache/src/commonMain/kotlin/dev/inmo/micro_utils/repos/cache/full/FullKeyValuesCacheRepo.kt @@ -159,6 +159,12 @@ open class FullKeyValuesCacheRepo( } } +fun KeyValuesRepo.fullyCached( + kvCache: FullKVCache>, + scope: CoroutineScope = CoroutineScope(Dispatchers.Default) +) = FullKeyValuesCacheRepo(this, kvCache, scope) + +@Deprecated("Renamed", ReplaceWith("this.fullyCached(kvCache, scope)", "dev.inmo.micro_utils.repos.cache.full.fullyCached")) fun KeyValuesRepo.caching( kvCache: FullKVCache>, scope: CoroutineScope = CoroutineScope(Dispatchers.Default)