karlseguin / ccache

A golang LRU Cache for high concurrency
MIT License
1.27k stars 118 forks source link

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

Closed rfyiamcool closed 8 months ago

rfyiamcool commented 9 months 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 ? 😁