0.Windows Service版下载
https://github.com/rgl/redis/downloads
1.新建一个Console项目
打开Nuget控制台,执行以下命令
Install-Package ServiceStack.Common -Version 3.9.71
Install-Package ServiceStack.Redis -Version 3.9.71
2.在Main中输入测试数据
using (var redis = new RedisClient(cacheIPAddress)) { //模拟各种写入 for (int i = 0; i < 1440 * 100; i++) { redis.PushItemToList("WriteCache", "Insert Into (aa,bb,cc,dd) Values (‘aa" + i + "‘,‘b<p>\"|[email protected]#@#$#%^%&^(^&()b‘,11,22)"); } //模拟另一个程序 while(redis.GetListCount("WriteCache")>0){ var sql = redis.RemoveStartFromList("WriteCache") //插入数据库 } }
时间: 2024-10-13 22:44:20