Ejemplo n.º 1
0
 public StringUnitTest(ITestOutputHelper testOutput)
 {
     redisHelper      = new Sample.RedisHelper();
     Connection       = RedisConnectionHelper.Instanse ?? RedisConnectionHelper.GetConnectionMultiplexer();
     Database         = Connection.GetDatabase(0);
     testOutputHelper = testOutput;
 }
Ejemplo n.º 2
0
 public RedisClient(int dbNum, string readWriteHosts)
 {
     DbNum = dbNum;
     _conn =
         string.IsNullOrWhiteSpace(readWriteHosts)
             ? RedisConnectionHelper.Instance
             : RedisConnectionHelper.GetConnectionMultiplexer(readWriteHosts);
 }
Ejemplo n.º 3
0
 public RedisClient(int dbNum, string expirySecond, string readWriteHosts)
 {
     DbNum = dbNum;//默认1
     _conn =
         string.IsNullOrWhiteSpace(readWriteHosts)
             ? RedisConnectionHelper.Instance
             : RedisConnectionHelper.GetConnectionMultiplexer(readWriteHosts);
     this.expiry = TimeSpan.FromSeconds(Double.Parse(expirySecond));
 }
Ejemplo n.º 4
0
 public RedisClient(int dbNum, string readWriteHosts)
 {
     DbNum = dbNum;
     _conn =
         string.IsNullOrWhiteSpace(readWriteHosts)
             ? RedisConnectionHelper.Instance
             : RedisConnectionHelper.GetConnectionMultiplexer(readWriteHosts);
     expiry = TimeSpan.FromHours(Double.Parse(CustomConfigParam.RedisExpiryHours));
 }