I would like to allow a max_bytesize to be set for a Concurrent::Map, which would stop the combination of the map and its entries from getting any bigger by automatically deleting entries when a new one is added. Deletion of the oldest entry is easy through Hash#shift. New entries would automatically make a FIFO cache, while an LRU cache would need each accessed entry to be deleted and re-added.
Is this something worth working up a PR for? If so, does anyone have any suggestions on what to do and what not to do?
I would like to allow a
max_bytesizeto be set for aConcurrent::Map, which would stop the combination of the map and its entries from getting any bigger by automatically deleting entries when a new one is added. Deletion of the oldest entry is easy throughHash#shift. New entries would automatically make a FIFO cache, while an LRU cache would need each accessed entry to be deleted and re-added.Is this something worth working up a PR for? If so, does anyone have any suggestions on what to do and what not to do?