Description
IServiceCollection services = new ServiceCollection();
services.AddEasyCaching(option =>
{
//use fasterkv cache
option.UseFasterKv(config =>
{
config.EnableLogging = true;
config.MaxRdSecond = -1;
}, "testcaching").WithMessagePack("testcaching");
});
IServiceProvider serviceProvider = services.BuildServiceProvider();
var factory = serviceProvider.GetService();
var caching = factory.GetCachingProvider("testcaching");
caching.TrySet("testcaching", $"testcachingmsg", TimeSpan.FromSeconds(1));
var msg = caching.Get("testcaching");
Debug.WriteLine($"caching msg->{msg}");
Thread.Sleep(3000);
var msg2 = caching.Get("testcaching", () => "12345", TimeSpan.FromSeconds(1));
Debug.WriteLine($"caching msg2->{msg2}");
print is
11:57:26:112 caching msg->testcachingmsg
11:57:29:114 caching msg2->testcachingmsg
I see issues setting MaxRdSecond to 0 or -1 has no effect
There is no such case. Why? In addition, the documentation of UseFasterKv is too few. I can only know from the preferred documentation that it is similar to the combination of UseInMemory and UseDisk. I don't know if this is the right understanding, there is so little documentation