public RedisDatabase(KeyValueDatabaseOptions <TKeyValueDbContext> options) { Check.NotNullOrWhiteSpace(options.ConnectionString, nameof(options.ConnectionString)); var endpoint = options.ConnectionString.ToRedisEndpoint(); _pooledRedisLite = new PooledRedisLite(endpoint.Host, endpoint.Port, db: (int)endpoint.Db); }
public static void NormalTest() { var redis = new PooledRedisLite("192.168.9.9"); var value = redis.GetString("xxxxxxx"); Console.WriteLine($"#### {value}"); }
private static void TestSimpleRedis() { var redis = new PooledRedisLite("192.168.9.9"); var stopWatch = new Stopwatch(); stopWatch.Start(); var taskArray = new Task[MaxThread]; for (var i = 0; i < taskArray.Length; i++) { taskArray[i] = Task.Factory.StartNew(TestSimpleRedisWorker, redis); } Task.WaitAll(taskArray); stopWatch.Stop(); Console.WriteLine($"SimpleRedis::Thread {MaxThread}, spend: {stopWatch.ElapsedMilliseconds} ms."); }