Example #1
0
File: main.go Project: catgatp/gol
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)
}
Example #2
0
func init() {
	cache1 = cacheStr.New(hash.HashJenkins, true, 20*time.Second, nil)
}
Example #3
0
File: main.go Project: catgatp/gol
func init() {
	_cache = cacheStr.New(hash.HashJenkins, true, 10*time.Minute, nil)
	go_cache = gocache.New(5*time.Minute, 10*time.Minute)
}