AddSendingMiddleware wraps the current sending method handler using the provided middleware. Middleware is applied from right to left, so that the first one is executed first. For example, AddSendingMiddleware(m1, m2, m3) augments the method handler as m1(m2(m3(handler))). Sending middleware is ca
(middleware ...Middleware)
| 1335 | // Sending middleware is called when a request is sent. It is useful for tasks |
| 1336 | // such as tracing, metrics, and adding progress tokens. |
| 1337 | func (s *Server) AddSendingMiddleware(middleware ...Middleware) { |
| 1338 | s.mu.Lock() |
| 1339 | defer s.mu.Unlock() |
| 1340 | addMiddleware(&s.sendingMethodHandler_, middleware) |
| 1341 | } |
| 1342 | |
| 1343 | // AddReceivingMiddleware wraps the current receiving method handler using |
| 1344 | // the provided middleware. Middleware is applied from right to left, so that the |