Ernest Nguyen Hung

Results 5 issues of Ernest Nguyen Hung

Introduce new struct `Metrics` containing simple metrics (hits, misses, insertions, deletions and evictions). Extend an API by adding `Metrics` method returning `Cache` (or `Sharded`) metrics.

enhancement

Although `imcache` supports entry `ttl`, it doesn't support policy evicting the entries by their expiration (ttl) timestamp (currently supported policies: `lru`, `lfu` and `rand`). Add the new eviction policy `EvictionPolicyTTL`....

enhancement

Add `GetAndRemove` to `Cache` and `Sharded`, it should atomically get the value under a given key and remove it from the cache.

enhancement
good first issue

To test the eviction callback functionality the following mock struct is used https://github.com/erni27/imcache/blob/master/imcache_test.go#L1018. Since the eviction callbacks are invoked in the separate goroutine(s), the assertion methods should wait _reasonable_ amount...

good first issue
tests

Add a new README section with brief comparison between `imcache` and other in-memory cache libraries. It would help users looking for an in-memory cache library to better understand if `imcache`...

documentation