public RedisSubHelp(Action <string, string> OnMessage) { var config = new RedisConfigs(); var _redisClient = new RedisClient(config.Host, config.Port); _sub = new RedisSubscription(_redisClient); _sub.OnMessage += OnMessage; }
/// <summary> /// 获取缓存实例 /// </summary> /// <param name="cacheType">Cache Type</param> /// <returns></returns> public static ICache Instance(CacheType cacheType) { switch (cacheType) { case CacheType.Redis: var config = new RedisConfigs(); return(new RedisCache(config)); default: return(null); } }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="redisConfig"></param> public RedisCache(RedisConfigs redisConfig) { _redisClient = new RedisClient(redisConfig.Host, redisConfig.Port); _config = redisConfig; }