(ctx context.Context)
| 166 | } |
| 167 | |
| 168 | func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) { |
| 169 | c := make(chan ExitStatus, 1) |
| 170 | go func() { |
| 171 | defer close(c) |
| 172 | ctx, span := tracing.StartSpan(ctx, "process.Wait", |
| 173 | tracing.WithAttribute("process.id", p.ID()), |
| 174 | tracing.WithAttribute("process.task.id", p.task.ID()), |
| 175 | ) |
| 176 | defer span.End() |
| 177 | r, err := p.task.client.TaskService().Wait(ctx, &tasks.WaitRequest{ |
| 178 | ContainerID: p.task.id, |
| 179 | ExecID: p.id, |
| 180 | }) |
| 181 | if err != nil { |
| 182 | c <- ExitStatus{ |
| 183 | code: UnknownExitStatus, |
| 184 | err: err, |
| 185 | } |
| 186 | return |
| 187 | } |
| 188 | c <- ExitStatus{ |
| 189 | code: r.ExitStatus, |
| 190 | exitedAt: protobuf.FromTimestamp(r.ExitedAt), |
| 191 | } |
| 192 | }() |
| 193 | return c, nil |
| 194 | } |
| 195 | |
| 196 | func (p *process) CloseIO(ctx context.Context, opts ...IOCloserOpts) error { |
| 197 | ctx, span := tracing.StartSpan(ctx, "process.CloseIO", |
nothing calls this directly
no test coverage detected