MCPcopy
hub / github.com/grpc/grpc-go / getChainUnaryHandler

Function getChainUnaryHandler

server.go:1251–1258  ·  view source on GitHub ↗
(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler)

Source from the content-addressed store, hash-verified

1249}
1250
1251func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler) UnaryHandler {
1252 if curr == len(interceptors)-1 {
1253 return finalHandler
1254 }
1255 return func(ctx context.Context, req any) (any, error) {
1256 return interceptors[curr+1](ctx, req, info, getChainUnaryHandler(interceptors, curr+1, info, finalHandler))
1257 }
1258}
1259
1260func (s *Server) processUnaryRPC(ctx context.Context, stream *transport.ServerStream, info *serviceInfo, md *MethodDesc, trInfo *traceInfo) (err error) {
1261 sh := s.statsHandler

Callers 1

chainUnaryInterceptorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected