MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / newRequestHandler

Method newRequestHandler

server/server.go:325–333  ·  view source on GitHub ↗

newRequestHandler returns a context-wrapped Handler to handle requests

(ctx context.Context)

Source from the content-addressed store, hash-verified

323
324// newRequestHandler returns a context-wrapped Handler to handle requests
325func (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

Callers 1

listenMethod · 0.95

Calls 4

sendErrorMethod · 0.95
dispatchRequestMethod · 0.95
ConnectedMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected