AddReceivingMiddleware wraps the current receiving method handler using the provided middleware. Middleware is applied from right to left, so that the first one is executed first. For example, AddReceivingMiddleware(m1, m2, m3) augments the method handler as m1(m2(m3(handler))). Receiving middlewa
(middleware ...Middleware)
| 890 | // Receiving middleware is called when a request is received. It is useful for tasks |
| 891 | // such as authentication, request logging and metrics. |
| 892 | func (c *Client) AddReceivingMiddleware(middleware ...Middleware) { |
| 893 | c.mu.Lock() |
| 894 | defer c.mu.Unlock() |
| 895 | addMiddleware(&c.receivingMethodHandler_, middleware) |
| 896 | } |
| 897 | |
| 898 | // clientMethodInfos maps from the RPC method name to serverMethodInfos. |
| 899 | // |