exec

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRING_LIT_PORT string = "-port"
	STRING_FMT_PORT string = "%d"
)
View Source
const (
	CMD_SET_CTX = iota
	CMD_SET_PATH
	CMD_SET_ARGS
	CMD_SPAWN
	CMD_CHECK
	CMD_KILL_ALL
)

Variables

View Source
var (
	CheckDelaySleep time.Duration = 250 * time.Millisecond
)

Functions

func CheckProcs

func CheckProcs(mgr process.IManager) error

func KillAllProcs

func KillAllProcs(mgr process.IManager) error

func SetArgs

func SetArgs(mgr process.IManager, args ...string) error

func SetContext

func SetContext(mgr process.IManager, ctx context.Context) error

func SetPath

func SetPath(mgr process.IManager, path string) error

func Spawn

func Spawn(mgr process.IManager, lgr logger.ILogger, cnf *Config) (*process.Process, error)

func SpawnProcs

func SpawnProcs(mgr process.IManager) error

Types

type Args

type Args struct {
	// contains filtered or unexported fields
}

func NewArgs

func NewArgs(port int, args []string) Args

func (Args) Get

func (a Args) Get(port int) []string

type Config

type Config struct {
	Count int // Number of processes.
	Base  int // Base port for RPC.
}

func NewConfig

func NewConfig(count, base int) *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(lgr logger.ILogger, count, base int) *Manager

func (*Manager) Check

func (m *Manager) Check()

func (*Manager) Dump

func (m *Manager) Dump()

func (*Manager) KillAll

func (m *Manager) KillAll()

func (*Manager) SetArgs

func (m *Manager) SetArgs(val Args)

func (*Manager) SetContext

func (m *Manager) SetContext(val context.Context)

func (*Manager) SetCount

func (m *Manager) SetCount(val int)

func (*Manager) SetPath

func (m *Manager) SetPath(val string)

func (*Manager) Spawn

func (m *Manager) Spawn()

type Process

type Process struct {
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(lgr logger.ILogger, cnf *Config) *Process

func (*Process) Action

func (p *Process) Action(state **process.State)

func (*Process) SetArgs

func (p *Process) SetArgs(args ...string)

func (*Process) SetContext

func (p *Process) SetContext(val context.Context)

func (*Process) SetCount

func (p *Process) SetCount(val int)

func (*Process) SetPath

func (p *Process) SetPath(val string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL