stackexchange.redis

Thread-safe publish with StackExchange.Redis

北城余情 提交于 2021-02-10 14:53:59
问题 Can I share one instance of ISubscriber for publishing messages into the same or different channels from different threads? This is not documented. Thanks. 回答1: Yes. All the key APIs in SE.Redis (the IDatabase , IServer , ISubscriber implementations) are fully thread-safe, with the expectation that they will be potentially shared and hammered from multiple threads. 来源: https://stackoverflow.com/questions/52828799/thread-safe-publish-with-stackexchange-redis

StackExchange.Redis timeout

丶灬走出姿态 提交于 2021-02-06 10:14:43
问题 Production environment is on Azure, using Redis Cache Standard 2.5GB . Example 1 System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> StackExchange.Redis.RedisTimeoutException: Timeout performing SETNX User.313123, inst: 49, mgr: Inactive, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: PRD-VM-WEB-2, serverEndpoint: Unspecified/Construct3.redis.cache.windows.net:6380, keyHashSlot: 15649, IOCP:

StackExchange.Redis timeout

浪子不回头ぞ 提交于 2021-02-06 10:07:12
问题 Production environment is on Azure, using Redis Cache Standard 2.5GB . Example 1 System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> StackExchange.Redis.RedisTimeoutException: Timeout performing SETNX User.313123, inst: 49, mgr: Inactive, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: PRD-VM-WEB-2, serverEndpoint: Unspecified/Construct3.redis.cache.windows.net:6380, keyHashSlot: 15649, IOCP:

stackexchange.redis throws timeout even after increasing timeout?

早过忘川 提交于 2021-01-28 06:45:25
问题 I am getting the following error when trying to delete from my cache: Timeout performing DEL test.com, inst: 0, mgr: ExecuteSelect, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: ORLWS052, serverEndpoint: Unspecified/pub-redis-16778.us-west-2-1.1.ec2.garantiadata.com:16778, keyHashSlot: 6928, IOCP: (Busy=3,Free=997,Min=4,Max=1000), WORKER: (Busy=4,Free=4091,Min=4,Max=4095), Local-CPU: 100% (Please take a look at this article for some common client-side

Communicate web app and api project using SignalR & StackExchangeRedis

时光怂恿深爱的人放手 提交于 2021-01-27 21:23:51
问题 I'm working with a project built with ASP.NET Core 2.2. The main solution contains multiple projects, which includes API, web and other class libraries. We've used SignalR to displaying shared messages/notifications between the API project and the web project. For example, adding a new employee record from an API should call SignalR Hub and all the web client should received the notification. To make it communicate, we have used Radis with SignalR // SignalR Configuration services.AddSignalR

How to use Moq to mock up the StackExchange.Redis ConnectionMultiplexer class?

放肆的年华 提交于 2021-01-27 04:06:24
问题 I am working to mock up behaviors related to the StackExchange.Redis library, but can't figure out how to properly mock the sealed classes it uses. A specific example is in my calling code I'm doing something like this: var cachable = command as IRedisCacheable; if (_cache.Multiplexer.IsConnected == false) { _logger.Debug("Not using the cache because the connection is not available"); cacheAvailable = false; } else if (cachable == null) { The key line in there is _cache.Multiplexer

How to use Moq to mock up the StackExchange.Redis ConnectionMultiplexer class?

烈酒焚心 提交于 2021-01-27 04:05:09
问题 I am working to mock up behaviors related to the StackExchange.Redis library, but can't figure out how to properly mock the sealed classes it uses. A specific example is in my calling code I'm doing something like this: var cachable = command as IRedisCacheable; if (_cache.Multiplexer.IsConnected == false) { _logger.Debug("Not using the cache because the connection is not available"); cacheAvailable = false; } else if (cachable == null) { The key line in there is _cache.Multiplexer

Problem in Lazy Connection logic in stackexchenage.redis

杀马特。学长 韩版系。学妹 提交于 2021-01-07 01:36:17
问题 I am facing one problem that for instance my redis server was unavaialble at start but starts later. But due to above logic my Muxer object always remain un connected even though my redis is started. seems like there is no such thing as reconnect on failure or some thing. I am using following for Redis Connection in my .net core 3.1 application private static readonly Lazy Conn = new Lazy( () => { try { if (ConfigOptions != null && ConfigOptions.Value != null) { return ConnectionMultiplexer

Problem in Lazy Connection logic in stackexchenage.redis

流过昼夜 提交于 2021-01-07 01:35:32
问题 I am facing one problem that for instance my redis server was unavaialble at start but starts later. But due to above logic my Muxer object always remain un connected even though my redis is started. seems like there is no such thing as reconnect on failure or some thing. I am using following for Redis Connection in my .net core 3.1 application private static readonly Lazy Conn = new Lazy( () => { try { if (ConfigOptions != null && ConfigOptions.Value != null) { return ConnectionMultiplexer

Redis C# - Using Incr value in a transaction

不羁岁月 提交于 2020-12-13 04:40:03
问题 I'm trying use Redis INCR and the incremented value to be used as a field in a Hash from C# using StackExchange.Redis. This question points similar to what I need, but in Node. The below is something like I need. ITransaction transation = m_connection.GetDatabase() .CreateTransaction(); Task<long> incrementTask = transation.StringIncrementAsync(sequenceNumberRedisKey); if (await transation.ExecuteAsync()) { long sequenceNumber = await incrementTask; await transation.HashSetAsync