Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

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})
}