Closed rf-0 closed 1 month ago
Hi @rf-0 , FusionCache is a cache, and I don't think it's suitable for it to have an atomic counter.
I would just use StringIncrement/StringDecrement.
At most, as an optimization, I would reuse the same IConnectionMultiplexer
, both directly and passed to RedisCache
to save 1 connection, but that's it.
Hope this helps, let me know.
Problem
Need atomic support for increment / decrementing values.
Solution
To be able to use something similar to redis.StringDecrementAsync and redis.StringIncrementAsync.
Alternatives
Additional context
Performance is imperative.
Question: If this is not possible for any reason, do you guys have a workaround? If I try to extend IFusionCache and use the redis methods it wont work since FusionCache is applying its own serialisation customisation to the cached data.