summaryrefslogtreecommitdiff
path: root/src/rhctl/playout_server.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-09-23 21:51:19 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-09-23 21:51:19 (GMT)
commit325fdfbf6fe7c10a2e4145d870d7f5310a1d4d2b (patch)
treed2df322a9496d948b45be11f15b75f01888f1f8f /src/rhctl/playout_server.go
parent52f05d3ff1231c2ab4cf4034d0ea2279eb7448c5 (diff)
implemented server command channel for handover
Diffstat (limited to 'src/rhctl/playout_server.go')
-rw-r--r--src/rhctl/playout_server.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rhctl/playout_server.go b/src/rhctl/playout_server.go
index a8cb399..325a3f6 100644
--- a/src/rhctl/playout_server.go
+++ b/src/rhctl/playout_server.go
@@ -62,6 +62,7 @@ type PlayoutServer struct {
hbcnt uint
state ServerState
StateChanges chan ServerState
+ Commands chan Command
UpdateRequest chan bool
SwitchUpdates chan SwitchUpdate
}
@@ -108,7 +109,7 @@ func (srv *PlayoutServer) handleMessage(data string) {
rhl.Printf("Server(%s) sent empty handover", srv.name)
return
}
- // TODO: send command to swichctrl: &Command{Type: CmdServer, Args: data[9:], Response: nil}
+ srv.Commands <- Command{Type: CmdServer, Args: []string{data[9:]}, Response: nil}
return
}
rhl.Printf("Server(%s): ignoring unknown message: %q", srv.name, data)
@@ -164,6 +165,7 @@ func ServerInit(name string, conf *Config) (srv *PlayoutServer, err error) {
srv.state.Health = ServerDead
srv.state.Channel = ""
srv.StateChanges = make(chan ServerState, 16)
+ srv.Commands = make(chan Command, 8)
srv.UpdateRequest = make(chan bool, 8)
srv.SwitchUpdates = make(chan SwitchUpdate, 32)