Faster.Cachify
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Faster.Cachify --version 1.0.1
NuGet\Install-Package Faster.Cachify -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Faster.Cachify" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Faster.Cachify --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Faster.Cachify, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Faster.Cachify as a Cake Addin #addin nuget:?package=Faster.Cachify&version=1.0.1 // Install Faster.Cachify as a Cake Tool #tool nuget:?package=Faster.Cachify&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Overview !
Persistence i.e. Hybrid (In-memory + Hard Disc) caching utility built on top of FasterKV.
Usage
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Cachify.Tests;
[TestClass()] public class CacheTests { private Supervisor cache;
[TestInitialize]
public void Init()
{
string path = @"C:\DataBase";
cache = new(path);
}
[TestMethod()]
public void GetAsyncListTest()
{
List<string> r = new() { "1", "2", "3" };
string key = "List";
cache.SetAsync(r, key).Wait();
var r2 = cache.GetAsync<List<string>>(key).Result;
Assert.AreEqual(r.Count, r2.Count);
}
[TestMethod()]
public void GetAsyncEmptyListTest()
{
List<string> r = new();
string key = "EmptyList";
cache.SetAsync(r, key).Wait();
var r2 = cache.GetAsync<List<string>>(key).Result;
Assert.AreEqual(r.Count, r2?.Count);
}
[TestMethod()]
public void GetAsyncDictTest()
{
Dictionary<string, string> r = new() { { "f", "f1" } };
string key = "Dict";
cache.SetAsync(r, key).Wait();
var r2 = cache.GetAsync<Dictionary<string, string>>(key).Result;
Assert.AreEqual(r.Count, r2.Count);
}
[TestMethod()]
public void GetAsyncEmptyDictTest()
{
Dictionary<string, string> r = new();
string key = "EmptyDict";
cache.SetAsync(r, key).Wait();
var r2 = cache.GetAsync<Dictionary<string, string>>(key).Result;
Assert.AreEqual(r.Count, r2?.Count);
}
[TestMethod()]
public void SetAsyncTest()
{
Rec r = new(Guid.NewGuid(), "Palash Generic", DateTime.Now);
cache.SetAsync(r, r.Name).Wait();
var r2 = cache.GetAsync<Rec>(r.Name).Result;
Assert.AreEqual(r, r2);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-preview.2.23128.3)
- Microsoft.FASTER.Core (>= 2.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.2.0 | 113 | 5/30/2024 |
2.1.0 | 103 | 5/21/2024 |
2.0.0 | 491 | 12/30/2023 |
1.3.0 | 390 | 12/30/2023 |
1.2.1 | 426 | 12/21/2023 |
1.2.0 | 397 | 12/21/2023 |
1.1.3 | 398 | 12/21/2023 |
1.1.2 | 477 | 12/18/2023 |
1.1.1 | 102 | 9/27/2023 |
1.1.0 | 135 | 7/14/2023 |
1.0.4 | 136 | 6/27/2023 |
1.0.3 | 111 | 5/26/2023 |
1.0.2 | 140 | 4/21/2023 |
1.0.1 | 133 | 4/3/2023 |
1.0.0 | 132 | 4/3/2023 |