Skip to content

Commit

Permalink
调整说明文档
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 14, 2023
1 parent ccc7f19 commit 3ae215a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Nuget:NewLife.Redis

---
### 特性
* 在ZTO大数据实时计算广泛应用,200多个Redis实例稳定工作一年多,每天处理近1亿包裹数据,日均调用量80亿次
* 2017年在ZTO大数据实时计算广泛应用,200多个Redis实例稳定工作一年多,每天处理近1亿条包裹数据,日均调用量80亿次
* 低延迟,Get/Set操作平均耗时200~600us(含往返网络通信)
* 大吞吐,自带连接池,最大支持1000并发
* 大吞吐,自带连接池,最大支持100000并发
* 高性能,支持二进制序列化

---
Expand All @@ -43,7 +43,7 @@ public static class RedisHelper
/// <summary>
/// Redis实例
/// </summary>
public static FullRedis redisConnection=FullRedis.Create("server=127.0.0.1:6379;password=123456;db=4");
public static FullRedis redisConnection { get; set; } = new FullRedis("127.0.0.1:6379", "123456", 4);
}

Console.WriteLine(RedisHelper.redisConnection.Keys);
Expand All @@ -61,7 +61,7 @@ Redis实现标准协议以及基础字符串操作,完整实现由独立开源
var rds = new FullRedis("127.0.0.1:6379", "pass", 7);
//var rds = new FullRedis();
//rds.Init("server=127.0.0.1:6379;password=pass;db=7");
rds.Log = XTrace.Log; // 调试日志。正式使用时注释
rds.Log = XTrace.Log;
```

### 基本操作
Expand All @@ -80,6 +80,8 @@ class User
添删改查:
```csharp
var rds = new FullRedis("127.0.0.1", null, 7);
rds.Log = XTrace.Log;
rds.ClientLog = XTrace.Log; // 调试日志。正式使用时注释
var user = new User { Name = "NewLife", CreateTime = DateTime.Now };
rds.Set("user", user, 3600);
var user2 = rds.Get<User>("user");
Expand Down Expand Up @@ -116,6 +118,8 @@ GetAll/SetAll 在Redis上是很常用的批量操作,同时获取或设置多
批量操作:
```csharp
var rds = new FullRedis("127.0.0.1", null, 7);
rds.Log = XTrace.Log;
rds.ClientLog = XTrace.Log; // 调试日志。正式使用时注释
var dic = new Dictionary<String, Object>
{
["name"] = "NewLife",
Expand Down Expand Up @@ -151,6 +155,8 @@ name=NewLife,time=2018-09-25 15:56:26,count=1234
高级操作:
```csharp
var rds = new FullRedis("127.0.0.1", null, 7);
rds.Log = XTrace.Log;
rds.ClientLog = XTrace.Log; // 调试日志。正式使用时注释
var flag = rds.Add("count", 5678);
XTrace.WriteLine(flag ? "Add成功" : "Add失败");
var ori = rds.Replace("count", 777);
Expand Down

0 comments on commit 3ae215a

Please sign in to comment.