MCPcopy Create free account
hub / github.com/cloudfoundry/garden / wait

Method wait

client/connection/stream_handler.go:74–96  ·  view source on GitHub ↗
(decoder *json.Decoder)

Source from the content-addressed store, hash-verified

72}
73
74func (sh *streamHandler) wait(decoder *json.Decoder) (int, error) {
75 for {
76 payload := &transport.ProcessPayload{}
77 err := decoder.Decode(payload)
78 if err != nil {
79 sh.wg.Wait()
80 return 0, fmt.Errorf("connection: decode failed: %s", err)
81 }
82
83 if payload.Error != nil {
84 sh.wg.Wait()
85 return 0, fmt.Errorf("connection: process error: %s", *payload.Error)
86 }
87
88 if payload.ExitStatus != nil {
89 sh.wg.Wait()
90 status := int(*payload.ExitStatus)
91 return status, nil
92 }
93
94 // discard other payloads
95 }
96}

Callers 1

streamProcessMethod · 0.80

Calls 1

WaitMethod · 0.65

Tested by

no test coverage detected