I’m looking for a cache that behaves like a vector. I’ve been using core.cache but those are maps. I just need a simple fifo eviction method. I realize that I can simply create my own using the CacheProtocol protocol but I wanted to know if something like this already exists or if there’s a reason this is a bad idea.
I’m looking for a cache that behaves like a vector. I’ve been using core.cache
Share
If all you need is a vector like interface to a cache then it is likely that a cache of indexes to values will suit your needs. I’m guessing a bit about your specific problem though it seems likely that using numbers as the keys to your cache would fill many use cases because vectors are conceptually very similar to maps of numbers to values:
if that is not enough then you could look at the current contents of your cache in the form of a vector like so:
in most cases it’s likely that using numbers as indexes will do the job for many people