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

Method sendGenericRequestLoop

pkg/controller/rtctrl/runtime.go:124–150  ·  view source on GitHub ↗

sendGenericRequestLoop

()

Source from the content-addressed store, hash-verified

122
123// sendGenericRequestLoop
124func (info *RuntimeInfo) sendGenericRequestLoop() {
125 encoder := json.NewEncoder(info.runtimeConn)
126loop:
127 for {
128 select {
129 case request := <-info.requestChan:
130 err := encoder.Encode(request)
131 requestInfo := info.loadRequest(request.RequestID)
132 if err != nil {
133 logs.Errorf("marshal invokeReq failed. %s", err.Error())
134 if requestInfo != nil {
135 requestInfo.InvokeResult(StatusFailed,
136 fmt.Sprintf("RequestID: %s Process exited before completing request", request.RequestID))
137 requestInfo.Notify()
138 }
139 }
140 if requestInfo != nil {
141 requestInfo.StepDone(StageSendRequest)
142 }
143 case <-info.runtimeStopChan:
144 break loop
145 }
146 }
147
148 info.runtimeWaitGroup.Done()
149 logs.Infof("runtime %s stop sending request", info.RuntimeID)
150}
151
152func (info *RuntimeInfo) sendHTTPRequestLoop() {
153 needStop := false

Callers 1

sendRequestLoopMethod · 0.95

Calls 10

EncodeMethod · 0.95
loadRequestMethod · 0.95
NewEncoderFunction · 0.92
ErrorfFunction · 0.92
InfofFunction · 0.92
InvokeResultMethod · 0.80
NotifyMethod · 0.80
DoneMethod · 0.80
ErrorMethod · 0.45
StepDoneMethod · 0.45

Tested by

no test coverage detected