move work on execution service
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
dd5f74edec
commit
c857213b4c
15 changed files with 596 additions and 1016 deletions
|
@ -1,41 +1,18 @@
|
|||
package execution
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/opencontainers/runtime-spec/specs-go"
|
||||
)
|
||||
|
||||
type ProcessController interface {
|
||||
Start(*Process) error
|
||||
Status(*Process) (Status, error)
|
||||
Wait(*Process) (uint32, error)
|
||||
Signal(*Process, os.Signal) error
|
||||
}
|
||||
type Process interface {
|
||||
ID() string
|
||||
Pid() int64
|
||||
Spec() *specs.Process
|
||||
|
||||
type Process struct {
|
||||
Pid int
|
||||
Spec *specs.Process
|
||||
Stdin io.Reader
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
|
||||
controller ProcessController
|
||||
}
|
||||
|
||||
func (p *Process) Status() (Status, error) {
|
||||
return p.controller.Status(p)
|
||||
}
|
||||
|
||||
func (p *Process) Wait() (uint32, error) {
|
||||
return p.controller.Wait(p)
|
||||
}
|
||||
|
||||
func (p *Process) Signal(s os.Signal) error {
|
||||
return p.controller.Signal(p, s)
|
||||
}
|
||||
|
||||
func (p *Process) Start() error {
|
||||
return p.controller.Start(p)
|
||||
Start() error
|
||||
Status() (Status, error)
|
||||
Wait() (uint32, error)
|
||||
Signal(os.Signal) error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue