MCPcopy Create free account
hub / github.com/docker/buildx / bufferDisplay

Method bufferDisplay

util/progress/printer.go:231–249  ·  view source on GitHub ↗

bufferDisplay will buffer display updates from the status channel into a slice. This method returns if either status gets closed or if an interrupt is received.

(ctx context.Context, ss []*client.SolveStatus)

Source from the content-addressed store, hash-verified

229//
230// This method returns if either status gets closed or if an interrupt is received.
231func (p *Printer) bufferDisplay(ctx context.Context, ss []*client.SolveStatus) ([]*client.SolveStatus, error) {
232 for {
233 select {
234 case s, ok := <-p.status:
235 if !ok {
236 p.state = printerStateDone
237 return ss, nil
238 }
239 ss = append(ss, s)
240 case req := <-p.interrupt:
241 p.state = req.desiredState
242 req.close()
243 return ss, nil
244 case <-ctx.Done():
245 p.state = printerStateDone
246 return nil, context.Cause(ctx)
247 }
248 }
249}
250
251func (p *Printer) WriteBuildRef(target string, ref string) {
252 p.buildRefsMu.Lock()

Callers 1

runMethod · 0.95

Calls 2

DoneMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected