process

package
v1.26.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	Cmd          *exec.Cmd
	Stdin        io.WriteCloser
	Stdout       io.ReadCloser
	Stderr       io.ReadCloser
	ReadStdoutFn func(io.Reader)
	ReadStderrFn func(io.Reader)
	RestartDelay time.Duration
	Log          telegraf.Logger
	// contains filtered or unexported fields
}

Process is a long-running process manager that will restart processes if they stop.

func New

func New(command []string, envs []string) (*Process, error)

New creates a new process wrapper

func (*Process) Pid

func (p *Process) Pid() int

func (*Process) Start

func (p *Process) Start() error

Start the process. A &Process can only be started once. It will restart itself as necessary.

func (*Process) Stop

func (p *Process) Stop()

Stop is called when the process isn't needed anymore

Jump to

Keyboard shortcuts

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