8000 Getting the to-be-evicted entry from LruMap · Issue #598 · google/quiver-dart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Getting the to-be-evicted entry from LruMap #598
Open
@MarcelGarus

Description

@MarcelGarus

Currently, it feels like LruMap only targets the reading-part of caching. I'm using LruMap to provide an in-memory cache as a layer before writing to disk.
If multiple writes occur to the same object, I want the write to disk to only happen once. Currently, there's no way of getting information about which element is going to be evicted next, so when a new element is written to, it's impossible to write the oldest one to disk.
A LruMap.toBeEvictedNext getter (or something with a better name) would be great. Or a method that sets an element and also directly returns the element that will be removed from the cache because of that write.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0