-
3 votesanswersviews
使用ServiceStack Redis进行分布式锁定的互斥锁违规
我正在尝试使用ServiceStack-Redis库和described here提供的锁定机制来实现DLM,但我发现API似乎存在竞争条件,有时会向多个客户端授予相同的锁 . BasicRedisClientManager mgr = new BasicRedisClientManager(redisConnStr); using(var client = mgr.GetClient()) {... -
0 votesanswersviews
如何在长时间运行的订阅线程中处理和恢复异常
我在几个ASP.NET MVC应用程序中使用ServiceStack.Redis,以促进这些应用程序之间的基本消息传递 . 在一个应用程序中,我有一个类来设置订阅并处理应用程序感兴趣的任何消息,例如: public MessageBus(IRedisClientsManager redisClientsManager) { Thread subscriptionThread = new T... -
2 votesanswersviews
无法使用ServiceStack.Redis库连接Redis缓存服务器
我已安装 PM> Install-Package ServiceStack.Redis 并使用以下代码连接azure redis缓存 . 我想我错过了连接字符串,因为我没有在 host 中给出 PRIMARY KEY string host = "mydemo.redis.cache.windows.net"; var redisManager =... -
1 votesanswersviews
根据属性值检索servicestack redis会话对象的选择
我想更新存储在redis中的多个servicestack用户会话 . 我想返回所有自定义属性设置为某个值的会话,然后我可以处理它们 . 目前我得到的最佳解决方案是返回所有密钥: List<string> sessionkeys = redis.SearchKeys("urn:iauthsession:*"); 我认为这不会很好 . 我想做一些类似的事情: List... -
2 votesanswersviews
ServiceStack RedisServerEvents创建了数千个密钥
我正在使用ServiceStack和RedisServerEvents插件来通知连接的客户端数据的变化 . 我有两个运行Apache / mod_mono / ServiceStack的Linux VM,一个Redis实例和一个HAProxy机器 . 我注意到的是,尽管目前每天只有6个活跃用户在测试软件(至少是使用SSE的部分),但我的Redis实例有数千个以“sse:id ...”开头的键 . ... -
2 votesanswersviews
如何在.net 核心中使用 redis 缓存页面?
我在某种程度上是 redis 的初学者,我知道如果你想缓存列表或对象或类似的东西,它在 redis 中很容易,但我不知道如何将我的网页存储在 redis 中?注意我正在使用 servicestack 作为我的 redis 客户端,并使用服务堆栈将数据保存到我的 redis 我正在使用这样的代码: IRedisClient redisClient = new RedisClient(); ... -
0 votesanswersviews
为什么ServiceStack.Redis不使用SET Timeout来获取锁?
如果您查看RedisLock.cs类的代码,您可以看到它正在读取锁定值以在Redis外部验证超时,并且如果没有人触摸它,它也会使用Watch和Unwatch来覆盖超时值 . 换句话说,使用Watch和unwatch并提交的确切要点是什么,而我们可以使用更可靠的Redis内部设置超时? ExecUtils.RetryUntilTrue(() =>{ //This pattern is ...