handleClientMsg is the top-level handler of messages received by the topic from sessions.
(msg *ClientComMessage)
| 619 | |
| 620 | // handleClientMsg is the top-level handler of messages received by the topic from sessions. |
| 621 | func (t *Topic) handleClientMsg(msg *ClientComMessage) { |
| 622 | if msg.Pub != nil { |
| 623 | t.handlePubBroadcast(msg) |
| 624 | } else if msg.Note != nil { |
| 625 | t.handleNoteBroadcast(msg) |
| 626 | } else { |
| 627 | // TODO(gene): maybe remove this panic. |
| 628 | logs.Err.Panic("topic: wrong client message type for broadcasting", t.name) |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | // handleServerMsg is the top-level handler of messages generated at the server. |
| 633 | func (t *Topic) handleServerMsg(msg *ServerComMessage) { |