reaper

package
v1.0.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &Monitor{
	cmds:    make(map[int]*Cmd),
	unknown: make(map[int]int),
}

Functions

func Reap

func Reap() error

Reap should be called when the process receives an SIGCHLD. Reap will reap all exited processes and close their wait channels

Types

type Cmd

type Cmd struct {
	ExitCh chan int
	// contains filtered or unexported fields
}

type Monitor

type Monitor struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Monitor) CombinedOutput

func (m *Monitor) CombinedOutput(c *exec.Cmd) ([]byte, error)

func (*Monitor) Command

func (m *Monitor) Command(pid int) *Cmd

Command returns the registered pid for the command created

func (*Monitor) Delete

func (m *Monitor) Delete(pid int)

func (*Monitor) Output

func (m *Monitor) Output(c *exec.Cmd) ([]byte, error)

func (*Monitor) Register

func (m *Monitor) Register(pid int, c *Cmd)

func (*Monitor) RegisterNL

func (m *Monitor) RegisterNL(pid int, c *Cmd)

RegisterNL does not grab the lock internally the caller is responsible for locking the monitor

func (*Monitor) Run

func (m *Monitor) Run(c *exec.Cmd) error

Run runs and waits for the command to finish

func (*Monitor) Start

func (m *Monitor) Start(c *exec.Cmd) error

Start starts the command a registers the process with the reaper

func (*Monitor) Wait

func (m *Monitor) Wait(c *exec.Cmd) (int, error)

func (*Monitor) WaitPid

func (m *Monitor) WaitPid(pid int) (int, error)

Jump to

Keyboard shortcuts

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