karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.31k stars 121 forks source link

feat: add setnx (if not exists, set kv) #85

Closed rfyiamcool closed 1 year ago

rfyiamcool commented 1 year ago

summary

add setnx function, if not exists, set kv atomically.

If you don't think setnx (redis) is not good, I'll switch to putIfAbsent ? 😁