Documentation ¶
Index ¶
- Constants
- func From(w worker.BaseProcess) (worker.SyncWorker, error)
- func InitBaseWorker(cmd *exec.Cmd, options ...Options) (worker.BaseProcess, error)
- type Options
- type Process
- func (w *Process) AttachRelay(rl relay.Relay)
- func (w *Process) Created() time.Time
- func (w *Process) Kill() error
- func (w *Process) Pid() int64
- func (w *Process) Relay() relay.Relay
- func (w *Process) Start() error
- func (w *Process) State() internal.State
- func (w *Process) Stop() error
- func (w *Process) String() string
- func (w *Process) Wait() error
Constants ¶
const ( // WaitDuration - for how long error buffer should attempt to aggregate error messages // before merging output together since lastError update (required to keep error update together). WaitDuration = 25 * time.Millisecond // ReadBufSize used to make a slice with specified length to read from stderr ReadBufSize = 10240 // Kb )
Variables ¶
This section is empty.
Functions ¶
func From ¶
func From(w worker.BaseProcess) (worker.SyncWorker, error)
From creates SyncWorker from BaseProcess
func InitBaseWorker ¶
InitBaseWorker creates new Process over given exec.cmd.
Types ¶
type Options ¶
type Options func(p *Process)
func AddListeners ¶
func AddListeners(listeners ...events.EventListener) Options
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process - supervised process with api over goridge.Relay.
func (*Process) AttachRelay ¶
State return receive-only Process state object, state can be used to safely access Process status, time when status changed and number of Process executions.
func (*Process) Kill ¶
Kill kills underlying process, make sure to call Wait() func to gather error log from the stderr. Does not waits for process completion!
func (*Process) Relay ¶
State return receive-only Process state object, state can be used to safely access Process status, time when status changed and number of Process executions.
func (*Process) State ¶
State return receive-only Process state object, state can be used to safely access Process status, time when status changed and number of Process executions.
func (*Process) Stop ¶
Stop sends soft termination command to the Process and waits for process completion.