diff --git a/README.md b/README.md index e409bc7..136e3f4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # Theine [![codecov](https://codecov.io/gh/Yiling-J/theine-go/branch/main/graph/badge.svg?token=E1HJLJH07V)](https://codecov.io/gh/Yiling-J/theine-go) -High performance in-memory cache inspired by [Caffeine](https://github.com/ben-manes/caffeine). +High performance in-memory & hybrid cache inspired by [Caffeine](https://github.com/ben-manes/caffeine). - Good performance +- Built-in ability to leverage DRAM and SSD - Support for Generics - High hit ratio with adaptive [W-TinyLFU](https://arxiv.org/pdf/1512.00727.pdf) eviction policy - Expired data are removed automatically using [hierarchical timer wheel](http://www.cs.columbia.edu/~nahum/w6998/papers/ton97-timing-wheels.pdf) @@ -89,11 +90,11 @@ import "github.com/Yiling-J/theine-go" // loader function: func(ctx context.Context, key K) (theine.Loaded[V], error) // Loaded struct should include cache value, cost and ttl, which required by Set method -client, err := theine.NewBuilder[string, string](1000).BuildWithLoader( +client, err := theine.NewBuilder[string, string](1000).Loading( func(ctx context.Context, key string) (theine.Loaded[string], error) { return theine.Loaded[string]{Value: key, Cost: 1, TTL: 0}, nil }, -) +).Build() if err != nil { panic(err) }