Documentation
¶
Overview ¶
Package jproc handle processes that communicate using json on stdin/stdout.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StdErrCallback ¶
StdErrCallback provide an "easy" way to read line from a subprocess stdrror stream.
It should be called on *exec.Cmd before calling Run/Start If it doesn't return an error and for some reason Wait is not called for the process, the Close of the closer should be called.
Types ¶
type Process ¶ added in v0.0.3
type Process struct {
// contains filtered or unexported fields
}
Process represents a process that get requests as json objects streamed to stdin (separated by a new line), and for each request, in order it send a reply to stdout
func StartWithStderr ¶
StartWithStderr an new process based on the command line and register a callback to be called for each line of stderr
func (*Process) Close ¶ added in v0.0.3
Close the process (killing it if it not already dead and stopping waiting goroutines)
func (*Process) Done ¶ added in v0.0.3
func (j *Process) Done() <-chan struct{}
Done return a channel is get closed when the process dies Note: If the process never started it return nil
func (*Process) Error ¶ added in v0.0.3
Error return the final error code of the process (or nil if doesn't have one)