GetAndSet? #467
Replies: 1 comment 1 reply
-
It's not possible, because the operations FusionCache can rely on are the ones available in the And here I'm not even talking about
I would need to know more details about the scenario, but one thing I can think about is that you may work with a lower
Understandable, and on top of stampede protection the community keeps telling me that when they start using features fail-safe, eager refresh or soft timeouts (oh, and auto-recovery, that is really helpful when 💩 hit the fan) they become quite useful tools in their toolbelt which they rely on. Let me know if Ican help you more. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to do a get and then use that value to modify only part of it and then set the updated value back into the cache as an atomic operation?
For some more background, we have a cache with both L1 & L2 but it is pre-filled from the db at startup. After that all updates are done via Set as messages come off our message bus. The message on the bus may only contain parts of the object stored in the cache e.g. 3 of 5 values hence why we would like to get from the cache first and apply updates to it. It is also important the cache has the most up to date information as soon as possible. These values do get written to the db but for preformance reasons we don't want to have to let them expire to then be retrieved from the db again as the general case. Is this possible?
Also messages for any given key tend to come in groups so we might get 5 messages for a given key almost simultaneously but then nothing for hours and items may stay in the cache for a couple of days with a fixed expiration time.
Maybe this is the wrong solution but the other features like cache stampede protection etc. make it appealing.
Beta Was this translation helpful? Give feedback.
All reactions