epam / CoroutinesCache

In mobile development exists solution for caching with RxJava usage, but there is no solutions for Kotlin Coroutines. The project is to provide this functionality to mobile community.
Apache License 2.0
162 stars 7 forks source link

Use CoroutineScope in cache operations #7

Open vvsevolodovich opened 5 years ago

vvsevolodovich commented 5 years ago

CoroutinesCache has a CoroutineScope parameter. Cache operations should be scoped, not entire cache. In most cases, cache is a singleton and we create it once per app lifetime since initialization of this object usually takes some time.

Dartlexx commented 5 years ago

Considering Roman Elizarov suggestion, if we change library API we may get rid of CoroutineScopes altogether. It will be up to user. The only question here is if we can improve this infinite loop in DeleteExpirableRecordsAction.