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
`Replace` returns true if the item existed (and thus was replaced). In the case where the key was not in the cache, the value *is not* inserted and false is returned.
111
113
114
+
### GetDropped
115
+
You can get the number of keys evicted due to memory pressure by calling `GetDropped`:
116
+
117
+
```go
118
+
dropped:= cache.GetDropped()
119
+
```
120
+
The counter is reset on every call. If the cache's gc is running, `GetDropped` waits for it to finish; it's meant ot be called asynchronously for statistics /monitoring purposes.
121
+
112
122
### Stop
113
123
The cache's background worker can be stopped by calling `Stop`. Once `Stop` is called
114
124
the cache should not be used (calls are likely to panic). Stop must be called in order to allow the garbage collector to reap the cache.
0 commit comments