OnConnect registers a callbacks which is called when a Kite connects to the k Kite.
(handler func(*Client))
| 302 | // OnConnect registers a callbacks which is called when a Kite connects |
| 303 | // to the k Kite. |
| 304 | func (k *Kite) OnConnect(handler func(*Client)) { |
| 305 | k.handlersMu.Lock() |
| 306 | k.onConnectHandlers = append(k.onConnectHandlers, handler) |
| 307 | k.handlersMu.Unlock() |
| 308 | } |
| 309 | |
| 310 | // OnFirstRequest registers a function to run when we receive first request |
| 311 | // from other Kite. |
no outgoing calls