stackexchange.redis

Redis C# - Using Incr value in a transaction

不问归期 提交于 2020-12-13 04:39:05
问题 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

Can you retrieve the TTL in Redis c#?

痞子三分冷 提交于 2020-06-25 21:08:55
问题 Is there any way to get the TTL (Time to Live) of a StackExchange.Redis key in c#? 回答1: I have little experience with redis but I believe you are referring to: (http://redis.io/commands/ttl). If so, try running the .KeyTimeToLive("RedisKeyHere") on your database connection object. See example: class Program { static void Main(string[] args) { ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); var db = redis.GetDatabase(0); var timeToLive = db.KeyTimeToLive(

Can you retrieve the TTL in Redis c#?

拜拜、爱过 提交于 2020-06-25 21:03:50
问题 Is there any way to get the TTL (Time to Live) of a StackExchange.Redis key in c#? 回答1: I have little experience with redis but I believe you are referring to: (http://redis.io/commands/ttl). If so, try running the .KeyTimeToLive("RedisKeyHere") on your database connection object. See example: class Program { static void Main(string[] args) { ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); var db = redis.GetDatabase(0); var timeToLive = db.KeyTimeToLive(

StackExchange.Redis Get function throws a TimeoutException

…衆ロ難τιáo~ 提交于 2020-06-24 14:39:31
问题 I'm using StackExchange.Redis with C# and the StackExchangeRedisCacheClient.Get function throws the following exception. myCacheClient.Database.StringGet(txtKey.Text) 'myCacheClient.Database.StringGet(txtKey.Text)' threw an exception of type 'System.TimeoutException' StackExchange.Redis.RedisValue {System.TimeoutException} Message "Timeout performing GET hi, inst: 12, mgr: ExecuteSelect, err: never, queue: 2, qu: 2, qs: 0, qc: 0, wr: 0, wq: 1, in: 0, ar: 0, IOCP: (Busy=0,Free=1000,Min=4,Max

Executing Redis Console commands in c#

≡放荡痞女 提交于 2020-05-28 03:28:58
问题 I need to get the "CLIENT LIST" output from redis console to be used in my c# application, is there a way to execute that command with the ConnectionMultiplexer? Or is there a built in method to find that information? 回答1: CLIENT LIST is a "server" command, not a "database" command (as differentiated here), so you need to use IServer / GetServer() instead of IDatabase / GetDatabase() . The link shown also shows how to do this. Once you have that: there are ClientList and ClientListAsync

Is there any recommended value of COUNT for SCAN / HSCAN command in REDIS?

别等时光非礼了梦想. 提交于 2020-03-12 05:33:01
问题 I have understood the meaning of COUNT in the case of REDIS SCAN. But, what is the ideal value for REDIS COUNT ? 回答1: The default value is 10 . It means the command will bring back more or less 10 keys , could be less if the keys are sparsely populated in the hash slots, or filtered out by the MATCH pattern. It could be more if some keys are sharing a hash slot. Anyhow, the work performed is proportional to the COUNT parameter. Redis is single-threaded. One of the reasons SCAN was introduced

Is there any recommended value of COUNT for SCAN / HSCAN command in REDIS?

痴心易碎 提交于 2020-03-12 05:32:21
问题 I have understood the meaning of COUNT in the case of REDIS SCAN. But, what is the ideal value for REDIS COUNT ? 回答1: The default value is 10 . It means the command will bring back more or less 10 keys , could be less if the keys are sparsely populated in the hash slots, or filtered out by the MATCH pattern. It could be more if some keys are sharing a hash slot. Anyhow, the work performed is proportional to the COUNT parameter. Redis is single-threaded. One of the reasons SCAN was introduced

Which datatype to use for this RedisCache implementation?

僤鯓⒐⒋嵵緔 提交于 2020-02-25 06:21:29
问题 I have the below DB table structure: Id(string) Type(string) BeginDate(datetime) CloseDate(dateime) Source(string) "+ww100" "L" 23-JAN-20 23-APRIL-20 XYZ "+ww100" "L" 23-JAN-20 23-APRIL-20 XYZ --- --- --- --- --- As you might have observed, this table does not have any primary key, which means there could be duplicate data. Now I need to store this table data in Redis cache and retrieve it subsequently. Example: I might wanna search based on the Id, even if there are multiple records, I want