Skip to content

A lightweight thread-safe LRU cache for .NET

License

Notifications You must be signed in to change notification settings

itinero/LRUCache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LRUCache

What is it?

A lightweight thread-safe LRU cache for .NET

How can I get it?

LRUCache is available as a NuGet package: https://www.nuget.org/packages/LRUCache

PM> Install-Package LRUCache

Why was it made?

I wanted a straightforward, lightweight thread-safe LRU cache, and I couldn't find a good one to just drop in anywhere on NuGet, so I made one.

Example Usage

var cache = new LRUCache<int, string>(capacity: 1000);
var key = 1;
var value = "Hello";
cache.Add(key, value);

string valueInCache;
cache.TryGetValue(key, out valueInCache);
// valueInCache is now "Hello"

About

A lightweight thread-safe LRU cache for .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%