Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/araddon/lruttl
Go LRU Cache with time based eviction (based on Google Vitesse Cache)
https://github.com/araddon/lruttl
Last synced: about 1 month ago
JSON representation
Go LRU Cache with time based eviction (based on Google Vitesse Cache)
- Host: GitHub
- URL: https://github.com/araddon/lruttl
- Owner: araddon
- Created: 2013-06-18T17:22:43.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-18T19:59:22.000Z (over 11 years ago)
- Last Synced: 2024-06-19T05:48:19.948Z (5 months ago)
- Language: Go
- Size: 109 KB
- Stars: 5
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Time Evict LRU
-------------------------This is a modification of the Vitesse LRU to include Time Based Eviction
http://code.google.com/p/vitess/source/browse/go/cache
example::
l := lruttl.NewTimeEvictLru(10000, 10*time.Minute, 1*time.Second)l.EvictCallback = func(key string, v lruttl.Value) {
fmt.Println("evicting ", key)
}for i := 0; i < 100; i++ {
istr := strconv.FormatInt(int64(i), 10)
l.Set("key"+istr, &CacheValue{i})
}