草庐IT

DatabaseAsync

全部标签

c# - 通过 c# 调用 Redis 异步,使用 "DatabaseAsync"使得每秒有 400-500 个请求时响应变慢

当我使用时:`publiccall(Func>func){vartask=func(redisInstance);task.wait();returntask.Result;}`调用:call(client=>redisInstance.SetMembersAsync(setName))它工作正常,但是当有很多请求时,“CPU”使用率会增加;但在第二种情况下:`publicasynccall2(Func>func){vartask=func(redisInstance);returnawaittask.Result;}`调用:call2(asyncclient=>awaitredisI

c# - 在 C# 的 StackExchange.Redis 中将什么用作 asyncState 对象(或从哪里获取它)

我尝试使用StackExchange.Redisnuget将同步Redis存储转换为.NETCore2.2WebAPI的异步实现。同步版本有效。BasicUsageGuide状态:Additionally,ifyouplantomakeuseoftheasynchronousAPIandyourequiretheTask.AsyncStatetohaveavalue,thiscanalsobespecified:intdatabaseNumber=...objectasyncState=...IDatabasedb=redis.GetDatabase(databaseNumber,as

c# - 在 C# 的 StackExchange.Redis 中将什么用作 asyncState 对象(或从哪里获取它)

我尝试使用StackExchange.Redisnuget将同步Redis存储转换为.NETCore2.2WebAPI的异步实现。同步版本有效。BasicUsageGuide状态:Additionally,ifyouplantomakeuseoftheasynchronousAPIandyourequiretheTask.AsyncStatetohaveavalue,thiscanalsobespecified:intdatabaseNumber=...objectasyncState=...IDatabasedb=redis.GetDatabase(databaseNumber,as