Skip to content

Commit

Permalink
[Update] add expire check interval doc in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qizhiwang committed May 6, 2021
1 parent d9405b4 commit 2543a1a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,28 @@ added key: 1
added key: 2
```

## Interval
### Expire check interval
```go
func main () {
gc := gcache.New(10).
LRU().
EvictedFunc(func(key, value interface{}) {
fmt.Printf("key: [%v] evicted\n", key)
}).
ExpireCheckInterval(300 * time.Millisecond).
Build()

_ = gc.SetWithExpire(1, 1, time.Second)

time.Sleep(time.Second * 2)
}
```

```
key: [1] evicted
```

# Author

**Jun Kimura**
Expand Down

0 comments on commit 2543a1a

Please sign in to comment.