MCPcopy
hub / github.com/containerd/containerd / Wait

Method Wait

client/task.go:342–367  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

340}
341
342func (t *task) Wait(ctx context.Context) (<-chan ExitStatus, error) {
343 c := make(chan ExitStatus, 1)
344 go func() {
345 defer close(c)
346 ctx, span := tracing.StartSpan(ctx, "task.Wait",
347 tracing.WithAttribute("task.id", t.ID()),
348 )
349 defer span.End()
350 r, err := t.client.TaskService().Wait(ctx, &tasks.WaitRequest{
351 ContainerID: t.id,
352 })
353 if err != nil {
354 c <- ExitStatus{
355 code: UnknownExitStatus,
356 err: err,
357 }
358 return
359 }
360
361 c <- ExitStatus{
362 code: r.ExitStatus,
363 exitedAt: protobuf.FromTimestamp(r.ExitedAt),
364 }
365 }()
366 return c, nil
367}
368
369// Delete deletes the task and its runtime state
370// it returns the exit status of the task and any errors that were encountered

Callers

nothing calls this directly

Calls 7

IDMethod · 0.95
StartSpanFunction · 0.92
WithAttributeFunction · 0.92
FromTimestampFunction · 0.92
EndMethod · 0.80
TaskServiceMethod · 0.80
WaitMethod · 0.65

Tested by

no test coverage detected