Add wait API endpoint for waiting on process exit
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user