Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FasterKv MaxRdSecond set 0 or -1 not come into effect #550

Open
dongzhaosheng73 opened this issue Sep 25, 2024 · 3 comments
Open

FasterKv MaxRdSecond set 0 or -1 not come into effect #550

dongzhaosheng73 opened this issue Sep 25, 2024 · 3 comments
Assignees

Comments

@dongzhaosheng73
Copy link

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

@Memoyu
Copy link
Contributor

Memoyu commented Sep 25, 2024

@dongzhaosheng73
EasyCaching中FasterKv缓存实现中Set设置的超时时间似乎有点问题(MaxRdSecond 同理),没有起作用,近期我会PR修复一下;

还有,更多关于FasterKv的信息可以移步看看microsoft/FASTER项目,以及官方文档

@dongzhaosheng73
Copy link
Author

@dongzhaosheng73 EasyCaching中FasterKv缓存实现中设置设置的超时时间好像有点问题(MaxRdSecond同理),没有操作系统,近期我会PR修复一下;

另外,更多关于FasterKv的信息可以移步看看microsoft/FASTER项目,以及官方文档

Thank you. Can UseInMemory and UseDisk be used together? Like, if the content cache does not match, it will automatically search the hard disk cache. Reassigning the cache automatically fills both caches but their lifetimes can be set separately, right?

@Memoyu
Copy link
Contributor

Memoyu commented Sep 26, 2024

Thank you. Can UseInMemory and UseDisk be used together? Like, if the content cache does not match, it will automatically search the hard disk cache. Reassigning the cache automatically fills both caches but their lifetimes can be set separately, right?

@dongzhaosheng73 目前没有这样的混合场景的实现,只有HybridCache中混合分布式缓存的实现,你可以参考这个自己实现。

@Memoyu Memoyu self-assigned this Sep 26, 2024
Memoyu added a commit to Memoyu/EasyCaching that referenced this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants