We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
same key is expiring twice with this config
val cache = Cache.Builder<String, String>() .maximumCacheSize(1_00) .expireAfterWrite(2.seconds) .expireAfterAccess(5.seconds) .eventListener { event -> when (event) { is CacheEvent.Created -> {} is CacheEvent.Updated -> {} is CacheEvent.Evicted -> { scope.launch { println("Evicted ${event.key}") } } is CacheEvent.Expired -> { scope.launch { println("Expire ${event.key}") } } is CacheEvent.Removed -> { println("Evicted") } } } .build()
here I launch different coroutine adding value in the cache
for (n in 0..100) { delay(100) scopeL.launch { schemas.put("n$n", "some value") println("n$n") } }
Result
... adding n18 adding n19 adding n20 Expire n0 Expire n2 Expire n1 Expire n0 Expire n1 Expire n2 adding n21 Expire n3 Expire n3 adding n22 Expire n4 Expire n4 adding n23 Expire n5 Expire n5 adding n24 Expire n6 Expire n6 adding n25 ...
The same keys are expiring twice
The text was updated successfully, but these errors were encountered:
No branches or pull requests
same key is expiring twice with this config
here I launch different coroutine adding value in the cache
Result
The same keys are expiring twice
The text was updated successfully, but these errors were encountered: