csredis icon indicating copy to clipboard operation
csredis copied to clipboard

Exception when IncrAsync

Open notabdc opened this issue 5 years ago • 0 comments

I write test codes following the example code in readme.md: using (var redis = new RedisClient("someIP")) { // fire-and-forget: results are not captured for (int i = 0; i < 5000; i++) { redis.IncrAsync("test1"); } ... } when i=0 it's fine, when i=1, I got exception: 在已经完成任务后,尝试将任务转换为最终状态。(try transfer task to complete status when task is already completed.) the stack is:

csredis.dll!CSRedis.Internal.IO.AsyncConnector.ConnectAsync() Line 51 C# csredis.dll!CSRedis.Internal.IO.AsyncConnector.CallAsync(CSRedis.RedisCommand command) Line 73 C# csredis.dll!CSRedis.Internal.RedisConnector.CallAsync(CSRedis.RedisCommand command) Line 97 C# csredis.dll!CSRedis.RedisClient.WriteAsync(CSRedis.RedisCommand command) Line 34 C# csredis.dll!CSRedis.RedisClient.IncrAsync(string key) Line 1530 C# TestApp.exe!TestApp.Program.Main(string[] args) Line 21 C# the code throw excetion is: public Task ConnectAsync() { if (_redisSocket.Connected) => _connectionTaskSource.SetResult(true);

do I missunstand something about the async task?

notabdc avatar Feb 29 '20 13:02 notabdc