Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cleaner ¶
Cleaner is a function that cleans up some resource provided by the operating system, such as stale processes in a process table or files in a temporary directory.
func NewChainedCleaner ¶
NewChainedCleaner creates a new Cleaner that invokes a series of existing Cleaner objects sequentially. If any of them fail, the first observed error is returned.
func NewCommandRunningCleaner ¶
NewCommandRunningCleaner creates a new Cleaner that executes a command on the system and expects it to succeed.
func NewDirectoryCleaner ¶
func NewDirectoryCleaner(directory filesystem.Directory, path string) Cleaner
NewDirectoryCleaner creates a Cleaner that can remove all files within a given directory. It can, for example, be used to remove files from build directories and system temporary directories.
func NewProcessTableCleaner ¶
func NewProcessTableCleaner(processTable ProcessTable) Cleaner
NewProcessTableCleaner creates a decorator for Runner that kills processes that were left behind by previous build actions (e.g., daemonized processes).
type IdleInvoker ¶
type IdleInvoker struct {
// contains filtered or unexported fields
}
IdleInvoker is a helper type for invoking a Cleaner function. As it's generally not safe to call a Cleaner function while one or more build actions are running, they should only be invoked when the system is idle.
IdleInvoker keeps track of a use count to determine whether the system is idle. When transitioning from idle to busy or from busy to idle, the Cleaner function is called.
func NewIdleInvoker ¶
func NewIdleInvoker(f Cleaner) *IdleInvoker
NewIdleInvoker creates a new IdleInvoker that is in the idle state.
type Process ¶
Process running on the operating system. This type contains a subset of the information normally displayed by tools such as ps and top.
type ProcessFilterFunc ¶
ProcessFilterFunc is a callback that is provided to NewFilteringProcessTable to act as a filter function for processes returned by GetProcesses(). Only processes for which this callback function returns true are returned.
type ProcessTable ¶
ProcessTable is an interface for extracting a list of processes running on the operating system.
var SystemProcessTable ProcessTable = systemProcessTable{}
SystemProcessTable corresponds with the process table of the locally running operating system. On this operating system the information is extracted from procfs.
func NewFilteringProcessTable ¶
func NewFilteringProcessTable(base ProcessTable, filter ProcessFilterFunc) ProcessTable
NewFilteringProcessTable is a decorator for ProcessTable that only causes it to return processes matching a given filter. These are the processes that bb_runner should consider terminating.