(sub *LogSubscription)
| 143 | } |
| 144 | |
| 145 | func (m *LogManager) Unsubscribe(sub *LogSubscription) { |
| 146 | m.mu.Lock() |
| 147 | defer m.mu.Unlock() |
| 148 | key := sourceKey{sub.Node, sub.Source} |
| 149 | if current, ok := m.subscribers[key]; ok && current == sub { |
| 150 | delete(m.subscribers, key) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func (m *LogManager) Observe(fn func(LogEvent)) int { |
| 155 | m.mu.Lock() |