MCPcopy
hub / github.com/containerd/containerd / handleResizing

Function handleResizing

internal/cri/server/streaming.go:79–102  ·  view source on GitHub ↗

handleResizing spawns a goroutine that processes the resize channel, calling resizeFunc for each remotecommand.TerminalSize received from the channel.

(ctx context.Context, resize <-chan remotecommand.TerminalSize, resizeFunc func(size remotecommand.TerminalSize))

Source from the content-addressed store, hash-verified

77// handleResizing spawns a goroutine that processes the resize channel, calling resizeFunc for each
78// remotecommand.TerminalSize received from the channel.
79func handleResizing(ctx context.Context, resize <-chan remotecommand.TerminalSize, resizeFunc func(size remotecommand.TerminalSize)) {
80 if resize == nil {
81 return
82 }
83
84 go func() {
85 defer runtime.HandleCrash()
86
87 for {
88 select {
89 case <-ctx.Done():
90 return
91 case size, ok := <-resize:
92 if !ok {
93 return
94 }
95 if size.Height < 1 || size.Width < 1 {
96 continue
97 }
98 resizeFunc(size)
99 }
100 }
101 }()
102}

Callers 2

execInternalMethod · 0.85
attachContainerMethod · 0.85

Calls 1

DoneMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…