Close closes the redis client along with the active subscriptions on it
()
| 46 | |
| 47 | // Close closes the redis client along with the active subscriptions on it |
| 48 | func (m *Module) Close() { |
| 49 | m.lock.Lock() |
| 50 | defer m.lock.Unlock() |
| 51 | |
| 52 | // Close all active subscriptions first |
| 53 | for _, sub := range m.mapping { |
| 54 | _ = sub.pubsub.Close() |
| 55 | } |
| 56 | m.mapping = map[string]*subscription{} |
| 57 | |
| 58 | // Close the redis client |
| 59 | _ = m.client.Close() |
| 60 | } |