newRequestHandler returns a context-wrapped Handler to handle requests
(ctx context.Context)
| 323 | |
| 324 | // newRequestHandler returns a context-wrapped Handler to handle requests |
| 325 | func (s *Server) newRequestHandler(ctx context.Context) func(subject string, reply string, req *proxy.Request) { |
| 326 | return func(subject string, reply string, req *proxy.Request) { |
| 327 | if !s.ari.Connected() { |
| 328 | s.sendError(reply, eris.New("ARI connection is down")) |
| 329 | return |
| 330 | } |
| 331 | go s.dispatchRequest(ctx, reply, req) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | // TODO: see if there is a more programmatic approach to this |
| 336 | // nolint: gocyclo |
no test coverage detected