MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / recvGenericResponseLoop

Method recvGenericResponseLoop

pkg/controller/rtctrl/runtime.go:237–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235}
236
237func (info *RuntimeInfo) recvGenericResponseLoop() {
238 defer info.stopRuntime()
239
240 urlParams := make(url.Values)
241 decoder := json.NewDecoder(info.runtimeConn)
242 for {
243 var output InvokeResponse
244 err := decoder.Decode(&output)
245 if err != nil {
246 if err == io.EOF {
247 logs.Infof("runtime %s read EOF", info.RuntimeID)
248 } else {
249 logs.Errorf("decode %s response error %s", info.RuntimeID, err.Error())
250 }
251 break
252 }
253 logs.V(6).Info("request done.",
254 zap.String("runtimeID", info.RuntimeID),
255 zap.String("request_id", output.RequestID),
256 zap.Bool("success", output.Success))
257 requestInfo := info.loadRequest(output.RequestID)
258 if requestInfo != nil {
259 requestInfo.StepDone(StageRecvResponse)
260 }
261 if output.Success {
262 urlParams.Set("success", "true")
263 info.handleInvokeDone(output.RequestID, &urlParams, output.FuncResult)
264 } else {
265 urlParams.Set("success", "false")
266 info.handleInvokeDone(output.RequestID, &urlParams, output.FuncError)
267 }
268 }
269
270 info.runtimeWaitGroup.Done()
271 logs.Infof("runtime %s stop receiving response", info.RuntimeID)
272}
273
274func (info *RuntimeInfo) recvHTTPResponseLoop() {
275L:

Callers 2

recvResponseLoopMethod · 0.95

Calls 14

stopRuntimeMethod · 0.95
DecodeMethod · 0.95
loadRequestMethod · 0.95
handleInvokeDoneMethod · 0.95
NewDecoderFunction · 0.92
InfofFunction · 0.92
ErrorfFunction · 0.92
VFunction · 0.92
DoneMethod · 0.80
InfoMethod · 0.65
StringMethod · 0.65
SetMethod · 0.65

Tested by 1