Is it there any LRU implementation of IDictionary?

前端 未结 10 1789
走了就别回头了
走了就别回头了 2020-11-29 21:20

I would like to implement a simple in-memory LRU cache system and I was thinking about a solution based on an IDictionary implementation which could handle an hashed LRU mec

10条回答
  •  野性不改
    2020-11-29 21:33

    I've recently released a class called LurchTable to address the need for a C# variant of the LinkedHashMap. A brief discussion of the LurchTable can be found here.

    Basic features:

    • Linked Concurrent Dictionary by Insertion, Modification, or Access
    • Dictionary/ConcurrentDictionary interface support
    • Peek/TryDequeue/Dequeue access to 'oldest' entry
    • Allows hard-limit on items enforced at insertion
    • Exposes events for add, update, and remove

    Source Code: http://csharptest.net/browse/src/Library/Collections/LurchTable.cs

    GitHub: https://github.com/csharptest/CSharpTest.Net.Collections

    HTML Help: http://help.csharptest.net/

    PM> Install-Package CSharpTest.Net.Collections

提交回复
热议问题