Add a new "live" Event type

This event type is used to notify consumers that everything following
are real-time events. This allow clients that request events from the
backlog to detect when those events have all been sent.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-02-25 16:39:54 -08:00
parent 3856e27560
commit 4ca592f56e

View file

@ -168,6 +168,11 @@ func (s *Supervisor) Events(from time.Time) chan Event {
}
}
}
// Notify the client that from now on it's live events
c <- Event{
Type: "live",
Timestamp: time.Now(),
}
return c
}