pubsub.go 228 B

123456789
  1. package cache
  2. func (p *RedisCache) Publish(channel string, message interface{}) (int64, error) {
  3. if p.isCluster {
  4. return p.cluster.Publish(channel, message).Result()
  5. }
  6. return p.client.Publish(channel, message).Result()
  7. }