Documentation ¶
Index ¶
- type Options
- type Process
- func (w *Process) AddCallback(cb func())
- func (w *Process) AttachRelay(rl relay.Relay)
- func (w *Process) Callback()
- func (w *Process) Created() time.Time
- func (w *Process) Exec(ctx context.Context, p *payload.Payload) (*payload.Payload, error)
- func (w *Process) Kill() error
- func (w *Process) MaxExecs() uint64
- func (w *Process) MaxExecsReached() bool
- func (w *Process) Pid() int64
- func (w *Process) Relay() relay.Relay
- func (w *Process) Start() error
- func (w *Process) State() *fsm.Fsm
- func (w *Process) Stop() error
- func (w *Process) StreamCancel(ctx context.Context) error
- func (w *Process) StreamIter() (*payload.Payload, bool, error)
- func (w *Process) StreamIterWithContext(ctx context.Context) (*payload.Payload, bool, error)
- func (w *Process) String() string
- func (w *Process) Wait() error
- func (w *Process) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process - supervised process with api over goridge.Relay.
func InitBaseWorker ¶
InitBaseWorker creates new Process over given exec.cmd.
func (*Process) AddCallback ¶ added in v4.5.0
func (w *Process) AddCallback(cb func())
func (*Process) AttachRelay ¶
AttachRelay attaches relay to the worker
func (*Process) Kill ¶
Kill kills underlying process, make sure to call Wait() func to gather error log from the stderr. Does not wait for process completion!
func (*Process) MaxExecsReached ¶ added in v4.7.0
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.
func (*Process) StreamCancel ¶ added in v4.4.0
StreamCancel sends stop bit to the worker
func (*Process) StreamIter ¶ added in v4.4.0
func (*Process) StreamIterWithContext ¶ added in v4.5.5
StreamIter returns true if stream is available and payload