ForwardIO forwards process's io to the specified reader/writer. Optionally specify ioCancelCallback which will be called when the process closes the specified IO. This will be useful for additional cleanup.
(in *ioset.In, ioCancelCallback func(error))
| 24 | // Optionally specify ioCancelCallback which will be called when |
| 25 | // the process closes the specified IO. This will be useful for additional cleanup. |
| 26 | func (p *Process) ForwardIO(in *ioset.In, ioCancelCallback func(error)) { |
| 27 | p.inEnd.SetIn(in) |
| 28 | if f := p.serveIOCancel; f != nil { |
| 29 | f(errors.WithStack(context.Canceled)) |
| 30 | } |
| 31 | p.serveIOCancel = ioCancelCallback |
| 32 | } |
| 33 | |
| 34 | // Done returns a channel where error or nil will be sent |
| 35 | // when the process exits. |