网站地图

当前位置: 震情作文网 > 行善的作文

Redis 号称每秒可写入好几万的数据。为什么我执

时间:2022-06-22 05:28人气:来源: 未知

//从主 redis中获取连接,写只有这么快
public IRedisClient GetClient() { lock (writeClients) { AssertValidReadWritePool(); RedisClient inActiveClient; while ((inActiveClient=GetInActiveWriteClient())==null) { if (PoolTimeout.HasValue) { // wait for a connection, cry out if made to wait too long if (!Monitor.Wait(writeClients, PoolTimeout.Value)) throw new TimeoutException(PoolTimeoutError); } else Monitor.Wait(writeClients, RecheckPoolAfterMs); } WritePoolIndex++; inActiveClient.Active =true; if (this.ConnectTimeout !=null) { inActiveClient.ConnectTimeout =this.ConnectTimeout.Value; } if (this.SocketSendTimeout.HasValue) { inActiveClient.SendTimeout =this.SocketSendTimeout.Value; } if (this.SocketReceiveTimeout.HasValue) { inActiveClient.ReceiveTimeout =this.SocketReceiveTimeout.Value; } if (this.IdleTimeOutSecs.HasValue) { inActiveClient.IdleTimeOutSecs =this.IdleTimeOutSecs.Value; } inActiveClient.NamespacePrefix = NamespacePrefix; //Reset database to default if changed if (inActiveClient.Db != Db) { inActiveClient.ChangeDb(Db); } return inActiveClient; } }

文章来源: http://www.everstarry.com文章标题: Redis 号称每秒可写入好几万的数据。为什么我执

原文地址:http://www.everstarry.com/xsdzw/11353.html

上一篇:roucheng

网站首页

下一篇:没有了



本类导航