diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-02-11 20:41:12 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-02-11 20:41:12 +0100 |
commit | ef93665838bd8fee51606ebcd95c84a82a3a1520 (patch) | |
tree | 24808352f6a75ca129b01239bb67cef3a710cf5e /cmd | |
parent | Merge branch 'master' of gitspread:dolmetschctl (diff) |
subscribing to controller events works now
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/dolmetschctl/dolmetschctl.go | 7 |
1 files changed, 5 insertions, 2 deletions
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.") } |