cache
cache copied to clipboard
Remove get and set from AtomicCache
I believe these methods were originally added with the thought this class should also implement Cache
, but it doesn't, and as an atomic cache, it likely shouldn't provide methods that could be a footgun.
Where do you see footgun potential?
get
and set
increase the potential for inadvertently breaking atomicity of the cache by setting a value based on a prior get. get
by itself may be acceptable and can perhaps remain, but providing set
makes it too easy to break the contract and overwrite a cache value based on a stale value.