// Start starts the command and returns cross-interfaces to its standard input, output and error. func (x *XCmd) Start() (xstdin circuit.X, xstdout, xstderr circuit.X, err error) { // stdin, err := x.cmd.StdinPipe() if err != nil { return nil, nil, nil, err } // stdout, err := x.cmd.StdoutPipe() if err != nil { return nil, nil, nil, err } // stderr, err := x.cmd.StderrPipe() if err != nil { return nil, nil, nil, err } // if err = x.cmd.Start(); err != nil { return nil, nil, nil, err } defer func() { go x.cmd.Wait() // Calling wait is necessary, otherwise child remains zombie }() return xyio.NewXWriteCloser(stdin), xyio.NewXReadCloser(stdout), xyio.NewXReadCloser(stderr), nil }
func (x XValve) Recv() (circuit.X, error) { r, err := x.Valve.Recv() if err != nil { return nil, errors.Pack(err) } return xio.NewXReadCloser(r), nil }
func (x XServer) Profile(name string) (circuit.X, error) { r, err := x.server.Profile(name) if err != nil { return nil, errors.Pack(err) } return xio.NewXReadCloser(r), nil }
func (x XContainer) Stderr() circuit.X { return xio.NewXReadCloser(x.Container.Stderr()) }
func (x XProc) Stderr() circuit.X { return xio.NewXReadCloser(x.Proc.Stderr()) }