Documentation ¶
Index ¶
- Constants
- type Allocator
- 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() worker.State
- func (w *Process) Stop() error
- func (w *Process) String() string
- func (w *Process) Wait() error
- func (w *Process) Write(p []byte) (int, error)
- type StateImpl
- type Worker
- func (tw *Worker) AttachRelay(rl relay.Relay)
- func (tw *Worker) Created() time.Time
- func (tw *Worker) Exec(p *payload.Payload) (*payload.Payload, error)
- func (tw *Worker) ExecStream(p *payload.Payload, resp chan *payload.Payload, stopCh chan struct{}) error
- func (tw *Worker) ExecStreamWithTTL(ctx context.Context, p *payload.Payload, resp chan *payload.Payload, ...) error
- func (tw *Worker) ExecWithTTL(ctx context.Context, p *payload.Payload) (*payload.Payload, error)
- func (tw *Worker) Kill() error
- func (tw *Worker) Pid() int64
- func (tw *Worker) Relay() relay.Relay
- func (tw *Worker) Start() error
- func (tw *Worker) State() worker.State
- func (tw *Worker) Stop() error
- func (tw *Worker) String() string
- func (tw *Worker) Wait() error
Constants ¶
const ( // StopRequest can be sent by worker to indicate that restart is required. // should be in sync with pool StopRequest = `{"stop":true}` )
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) 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) 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.
type StateImpl ¶
type StateImpl struct {
// contains filtered or unexported fields
}
func NewWorkerState ¶
NewWorkerState initializes a state for the sync.Worker
func (*StateImpl) RegisterExec ¶
func (s *StateImpl) RegisterExec()
RegisterExec register new execution atomically
func (*StateImpl) SetLastUsed ¶
SetLastUsed Update last used time
type Worker ¶ added in v2.12.0
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) AttachRelay ¶ added in v2.12.0
func (*Worker) ExecStream ¶ added in v2.12.0
func (*Worker) ExecStreamWithTTL ¶ added in v2.12.0
func (*Worker) ExecWithTTL ¶ added in v2.12.0
ExecWithTTL executes payload without TTL timeout.