process

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecCmd

type ExecCmd interface {
	Start() error
	Wait() error
	OsProcess() OsProcess
}

type OsProcess

type OsProcess interface {
	Signal(os.Signal) error
	Kill() error
}

type Process

type Process struct {
	ExecCmd
}

func NewWithCmd

func NewWithCmd(cmd *exec.Cmd) *Process

func (*Process) WaitOrKill

func (p *Process) WaitOrKill(ctx context.Context, killDelay time.Duration) error

WaitOrKill waits for the already-started process by calling its Wait method.

If the process does not return before ctx is done, WaitOrKill sends it the given interrupt signal. If killDelay is positive, WaitOrKill waits that additional period for Wait to return before sending os.Kill.

Adapted from Go core: https://github.com/golang/go/blob/8981092d71aee273d27b0e11cf932a34d4d365c1/src/cmd/go/script_test.go#L1131-L1190

Jump to

Keyboard shortcuts

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