Improve event emitter/subscription abilities

This commit is contained in:
Dane Everitt
2020-01-18 14:04:26 -08:00
parent c6fcd8cabb
commit 99a11f81c3
8 changed files with 131 additions and 103 deletions

View File

@@ -388,7 +388,7 @@ func (d *DockerEnvironment) FollowConsoleOutput() error {
s := bufio.NewScanner(r)
for s.Scan() {
d.Server.Emit(ConsoleOutputEvent, s.Text())
d.Server.Events().Publish(ConsoleOutputEvent, s.Text())
}
if err := s.Err(); err != nil {
@@ -450,7 +450,7 @@ func (d *DockerEnvironment) EnableResourcePolling() error {
}
b, _ := json.Marshal(s.Resources)
s.Emit(StatsEvent, string(b))
s.Events().Publish(StatsEvent, string(b))
}
}(d.Server)