From ef93665838bd8fee51606ebcd95c84a82a3a1520 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 11 Feb 2019 20:41:12 +0100 Subject: subscribing to controller events works now --- cmd/dolmetschctl/dolmetschctl.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/dolmetschctl/dolmetschctl.go b/cmd/dolmetschctl/dolmetschctl.go index 6055896..a1598bc 100644 --- a/cmd/dolmetschctl/dolmetschctl.go +++ b/cmd/dolmetschctl/dolmetschctl.go @@ -25,7 +25,6 @@ package main import ( "log" "os" - "time" "spreadspace.org/dolmetschctl/pkg/controller" ) @@ -47,8 +46,12 @@ func main() { log.Printf("controller successfully initialized!") + ch := make(chan controller.Event, 100) + c.Subscribe(ch) for { - time.Sleep(1 * time.Second) + ev := <-ch + log.Printf("got controller event: %v", ev) } + log.Printf("exiting.") } -- cgit v1.2.3