зеркало из https://github.com/microsoft/docker.git
Engine: integer job status, improved stream API
* Jobs return an integer status instead of a string * Status convention mimics unix process execution: 0=success, 1=generic error, 127="no such command" * Stdout and Stderr support multiple thread-safe data receivers and ring buffer filtering
This commit is contained in:
Родитель
bd292759f0
Коммит
bef8de9319
|
@ -24,7 +24,7 @@ type Job struct {
|
||||||
Eng *Engine
|
Eng *Engine
|
||||||
Name string
|
Name string
|
||||||
Args []string
|
Args []string
|
||||||
env *Env
|
env *Env
|
||||||
Stdout *Output
|
Stdout *Output
|
||||||
Stderr *Output
|
Stderr *Output
|
||||||
Stdin *Input
|
Stdin *Input
|
||||||
|
|
|
@ -168,7 +168,7 @@ func Tail(src io.Reader, n int, dst *[]string) {
|
||||||
// AddEnv starts a new goroutine which will decode all subsequent data
|
// AddEnv starts a new goroutine which will decode all subsequent data
|
||||||
// as a stream of json-encoded objects, and point `dst` to the last
|
// as a stream of json-encoded objects, and point `dst` to the last
|
||||||
// decoded object.
|
// decoded object.
|
||||||
// The result `env` can be queried using the type-neutral Env interface.
|
// The result `env` can be queried using the type-neutral Env interface.
|
||||||
// It is not safe to query `env` until the Output is closed.
|
// It is not safe to query `env` until the Output is closed.
|
||||||
func (o *Output) AddEnv() (dst *Env, err error) {
|
func (o *Output) AddEnv() (dst *Env, err error) {
|
||||||
src, err := o.AddPipe()
|
src, err := o.AddPipe()
|
||||||
|
@ -185,9 +185,8 @@ func (o *Output) AddEnv() (dst *Env, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
*dst= *env
|
*dst = *env
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
return dst, nil
|
return dst, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче