MCPcopy Index your code
hub / github.com/coder/coder / loopResp

Method loopResp

tailnet/service.go:282–302  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282func (c communicator) loopResp() {
283 ctx := c.stream.Context()
284 defer func() {
285 err := c.stream.Close()
286 if err != nil {
287 c.logger.Debug(ctx, "loopResp hit error closing stream", slog.Error(err))
288 }
289 }()
290 for {
291 resp, err := RecvCtx(ctx, c.resps)
292 if err != nil {
293 c.logger.Debug(ctx, "loopResp failed to get response", slog.Error(err))
294 return
295 }
296 err = c.stream.Send(resp)
297 if err != nil {
298 c.logger.Debug(ctx, "loopResp failed to send response to DRPC stream", slog.Error(err))
299 return
300 }
301 }
302}
303
304type NetworkTelemetryBatcher struct {
305 clock quartz.Clock

Callers 1

communicateMethod · 0.95

Calls 5

RecvCtxFunction · 0.85
ContextMethod · 0.65
CloseMethod · 0.65
SendMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected