You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usage
Example
func main() {
cache, err := ristretto.NewCache(&ristretto.Config{
NumCounters: 1e7, // number of keys to track frequency of (10M).
MaxCost: 1 << 30, // maximum cost of cache (1GB).
BufferItems: 64, // number of keys per Get buffer.
})
if err != nil {
panic(err)
}
// set a value with a cost of 1
cache.Set("key", "value", 1)
// wait for value to pass through buffers
time.Sleep(10 * time.Millisecond)
value, found := cache.Get("key")
if !found {
panic("missing value")
}
fmt.Println(value)
cache.Del("key")
}
The text was updated successfully, but these errors were encountered:
kaidaguerre
changed the title
Connection config cache results are not available if read back immediately
Connection config cache data not available if read back immediately
Apr 8, 2021
as per the ristretto cache documentation: https://github.com/dgraph-io/ristretto/blob/master/README.md, a short (10ms) delay is required after a cache set to ensure the data passes through the buffers
The text was updated successfully, but these errors were encountered: