Add event id to router events

This commit is contained in:
Asim Aslam
2020-01-23 11:44:06 +00:00
parent 1c19678d04
commit 77c2a021da
6 changed files with 68 additions and 48 deletions

View File

@@ -38,6 +38,10 @@ func (t *table) sendEvent(e *Event) {
t.RLock()
defer t.RUnlock()
if len(e.Id) == 0 {
e.Id = uuid.New().String()
}
for _, w := range t.watchers {
select {
case w.resChan <- e: