Event should be called with events coming from the terminal. The distribution system will distribute these to all the subscribers.
(ev terminalapi.Event)
| 175 | // Event should be called with events coming from the terminal. |
| 176 | // The distribution system will distribute these to all the subscribers. |
| 177 | func (eds *DistributionSystem) Event(ev terminalapi.Event) { |
| 178 | eds.mu.Lock() |
| 179 | defer eds.mu.Unlock() |
| 180 | |
| 181 | for _, sub := range eds.subscribers { |
| 182 | sub.event(ev) |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | // StopFunc when called unsubscribes the subscriber from all events and |
| 187 | // releases resources tied to the subscriber. |