/// <summary> /// 订阅主题 /// </summary> /// <param name="key"></param> /// <param name="func"></param> /// <returns></returns> public void Subscribe <T>(string channel, Action <T> func) { CsRedisFactory.GetDatabase().Subscribe((channel, message => { func.Invoke(_serialize.DeserializesJson <T>(message.Body)); } )); }