cache
cache copied to clipboard
Mango Cache 🥭 - Partial implementation of Guava Cache in Go (golang).
version: v0.1.4 If only set refreshAfterWrite: The value in cache won't refresh until c.readCount > 64 or send write event, even if the key has expired. Before that, we can...
This PR adds a few missing functions to make it useful as an in-memory cache.
```go // refreshAsync reloads value in a go routine or using custom executor if defined. func (c *localCache) refreshAsync(en *entry) bool { if en.setLoading(true) { // Only do refresh if...
Hey, I encountered an issue where RemovalListener callback is called with the new value instead of the one that was expired, this should not be happening am I correct? Here...
The following Java code using Google Guava works as expected: ```java LoadingCache cache = CacheBuilder.newBuilder() .expireAfterWrite(1, TimeUnit.SECONDS) .build(new CacheLoader() { @Override public AtomicInteger load(@NotNull String key) { return new AtomicInteger();...
some go routines call the Get function for one key at the same time, may put pressure on the server
 if the key is loading ,need wait. Thanks
As you observed with the Youtube trace, the static configuration of W-TinyLFU is not optimal across all workloads. We spent some time exploring options and have a really good solution...
Hey 👋 I'm a keen user of the library. Thanks a lot for the work. It's a fantastic package. Simple and functional. I recently had a use case where I'd...
I recently implemented it in our downstream project. I'd be happy to contribute back to the upstream if you want to have it. https://github.com/parca-dev/parca-agent/blob/main/pkg/cache/stats_counter.go I understand if you want to...
This adds type parameters and remove the use of `interface{}` and type assertions for improved type safety. I have not observe any significant impact on performance (positive or negative). It...