OnRegister registers a callback which is called when a Kite registers to a Kontrol.
(handler func(*protocol.RegisterResult))
| 325 | // OnRegister registers a callback which is called when a Kite registers |
| 326 | // to a Kontrol. |
| 327 | func (k *Kite) OnRegister(handler func(*protocol.RegisterResult)) { |
| 328 | k.handlersMu.Lock() |
| 329 | k.onRegisterHandlers = append(k.onRegisterHandlers, handler) |
| 330 | k.handlersMu.Unlock() |
| 331 | } |
| 332 | |
| 333 | func (k *Kite) callOnConnectHandlers(c *Client) { |
| 334 | k.handlersMu.RLock() |
no outgoing calls