-
Notifications
You must be signed in to change notification settings - Fork 71
Description
When getting a resource from a store, the store might not have it locally, and will therefore try to fetch it by sending a request to its subject URL. When this happens, we want to store the newly fetched data to our store for caching. Because of this, any get command can also mutate the store. This is kind of not cool, because &mut references are exclusive. I'm kind of new to rust, but I believe this will prevent that multiple threads can do anything with this same store. This could cause latency spikes that will affect performance.
atomic_lib uses Sled, an embedded Rust key-value database, and it works entirely without mutable references. There must be something to learn here... Interesting video by the creator of sled touching this subject here.