runCallback is called when a callback method call is received from remote Kite.
(callback func(*dnode.Partial), args *dnode.Partial)
| 120 | |
| 121 | // runCallback is called when a callback method call is received from remote Kite. |
| 122 | func (c *Client) runCallback(callback func(*dnode.Partial), args *dnode.Partial) { |
| 123 | // Do not panic no matter what. |
| 124 | defer func() { |
| 125 | if err := recover(); err != nil { |
| 126 | c.LocalKite.Log.Warning("Error in calling the callback function : %v", err) |
| 127 | } |
| 128 | }() |
| 129 | |
| 130 | // Call the callback function. |
| 131 | callback(args) |
| 132 | } |
| 133 | |
| 134 | // newRequest returns a new *Request from the method and arguments passed. |
| 135 | func (c *Client) newRequest(method string, args *dnode.Partial) (*Request, func(interface{}, *Error)) { |