StackExchange.Redis Async with Fire and Forget not setting the keys

90 views Asked by At

I'm trying to figure out when I try to use Redisclient with Async operations with command flag as Fire and Forget, out of 5 stringSet only 3 is getting set 2 strings are not available in the server. Is it right to mix both Async and FireAndForget ?

Following is the code I tried, when called 5 times I could see only 3 values are set.

return await _redisDBClient.StringSetAsync(key, value, flags: CommandFlags.FireAndForget);
1

There are 1 answers

0
İsmail Furkan GÖKHASAN On

CommandFlags.FireAndForget is returning immediately so it is meaningless using it with redis.XxxAsync calls. In this situation, if redis reply with an error to any of the operations, StackExchange.Redis will ignore those errors.

Source: docs