Add wait API endpoint for waiting on process exit

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-09-18 15:54:29 -04:00
parent 2f5dda6229
commit d67763d922
23 changed files with 1314 additions and 355 deletions

View File

@@ -178,3 +178,16 @@ func (p *process) Start(ctx context.Context) (err error) {
p.hcs = hp
return nil
}
func (p *process) Wait(ctx context.Context) (*runtime.Exit, error) {
<-p.exitCh
ec, ea, err := p.ExitCode()
if err != nil {
return nil, err
}
return &runtime.Exit{
Status: ec,
Timestamp: ea,
}, nil
}