func main() { var ( t int ) n := cacheStr.New(hash.HashJenkins, true, 0*time.Minute, nil) for t = 0; t < 200000; t++ { n.Set("ind uhgyug e x try"+strconv.Itoa(t), t, 1, cacheStr.UpdateOrInsert) } n.Set("ind", 101, 1, cacheStr.UpdateOrInsert) n.Inc("ind", -1) fmt.Println("Decrement: ", n.Get("ind")) //time.Sleep(10 * time.Second) fmt.Print(n.GetBucketsStat()) n = nil //runtime.GC() //runtime.Gosched() //time.Sleep(10 * time.Second) }
func init() { cache1 = cacheStr.New(hash.HashJenkins, true, 20*time.Second, nil) }
func init() { _cache = cacheStr.New(hash.HashJenkins, true, 10*time.Minute, nil) go_cache = gocache.New(5*time.Minute, 10*time.Minute) }