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);
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:
do I missunstand something about the async task?