destroyEventConsumer removes the given channel from the list of channels that events should be sent to and closes it.
(ch chan clientv3.Event)
| 143 | // destroyEventConsumer removes the given channel from the list of channels that events |
| 144 | // should be sent to and closes it. |
| 145 | func (m *mockKV) destroyEventConsumer(ch chan clientv3.Event) { |
| 146 | m.eventsMtx.Lock() |
| 147 | delete(m.events, ch) |
| 148 | m.eventsMtx.Unlock() |
| 149 | close(ch) |
| 150 | } |
| 151 | |
| 152 | // sendEvent writes an event to all currently registered events. The consumer |
| 153 | // channels are each read by a goroutine that filters the event and sends it to |