OnTokenRenew adds a callback which is called when client successfully renews its token.
(handler func(token string))
| 633 | // OnTokenRenew adds a callback which is called when client successfully |
| 634 | // renews its token. |
| 635 | func (c *Client) OnTokenRenew(handler func(token string)) { |
| 636 | c.m.Lock() |
| 637 | c.onTokenRenewHandlers = append(c.onTokenRenewHandlers, handler) |
| 638 | c.m.Unlock() |
| 639 | } |
| 640 | |
| 641 | // callOnConnectHandlers runs the registered connect handlers. |
| 642 | func (c *Client) callOnConnectHandlers() { |