process_tracker

package
v0.333.2-candidate Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PidFromFile

func PidFromFile(pidFilePath string, timeout time.Duration) (int, error)

Types

type LinkSignaller

type LinkSignaller struct {
}

func (*LinkSignaller) Signal

func (e *LinkSignaller) Signal(signal *SignalRequest) error

type MsgSender

type MsgSender interface {
	SendMsg(msg []byte) error
}

type NamespacedSignaller

type NamespacedSignaller struct {
	Runner        command_runner.CommandRunner
	ContainerPath string
	Logger        lager.Logger
	Timeout       time.Duration
}

Kills a process by invoking ./bin/wsh in the given container path using a PID read from the given pidFile

func (*NamespacedSignaller) Signal

func (n *NamespacedSignaller) Signal(request *SignalRequest) error

type Process

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

func NewProcess

func NewProcess(
	logger lager.Logger,
	id string,
	containerPath string,
	runner command_runner.CommandRunner,
	signaller Signaller,
) *Process

func (*Process) Attach

func (p *Process) Attach(processIO garden.ProcessIO)

func (*Process) ID

func (p *Process) ID() string
func (p *Process) Link()

func (*Process) SetTTY

func (p *Process) SetTTY(tty garden.TTYSpec) error

func (*Process) Signal

func (p *Process) Signal(signal garden.Signal) error

func (*Process) Spawn

func (p *Process) Spawn(cmd *exec.Cmd, tty *garden.TTYSpec) (ready, active chan error)

func (*Process) Wait

func (p *Process) Wait() (int, error)

type ProcessTracker

type ProcessTracker interface {
	Run(processID string, cmd *exec.Cmd, io garden.ProcessIO, tty *garden.TTYSpec, signaller Signaller) (garden.Process, error)
	Attach(processID string, io garden.ProcessIO) (garden.Process, error)
	Restore(processID string, signaller Signaller)
	ActiveProcesses() []garden.Process
}

func New

func New(logger lager.Logger, containerPath string, runner command_runner.CommandRunner) ProcessTracker

type SignalRequest

type SignalRequest struct {
	Pid    string
	Signal syscall.Signal
	Link   MsgSender
}

type Signaller

type Signaller interface {
	Signal(*SignalRequest) error
}

type UnknownProcessError

type UnknownProcessError struct {
	ProcessID string
}

func (UnknownProcessError) Error

func (e UnknownProcessError) Error() string

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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