package processes

import "github.com/docker/buildx/controller/processes"

Index

Types

type Manager

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

Manager manages a set of proceses.

func NewManager

func NewManager() *Manager

NewManager creates and returns a Manager.

func (*Manager) CancelRunningProcesses

func (m *Manager) CancelRunningProcesses()

CancelRunningProcesses cancels execution of all running processes.

func (*Manager) DeleteProcess

func (m *Manager) DeleteProcess(id string) error

DeleteProcess deletes the specified process.

func (*Manager) Get

func (m *Manager) Get(id string) (*Process, bool)

Get returns the specified process.

func (*Manager) ListProcesses

func (m *Manager) ListProcesses() (res []*pb.ProcessInfo)

ListProcesses lists all running processes.

func (*Manager) StartProcess

func (m *Manager) StartProcess(pid string, resultCtx *build.ResultHandle, cfg *pb.InvokeConfig) (*Process, error)

StartProcess starts a process in the container. When a container isn't available (i.e. first time invoking or the container has exited) or cfg.Rollback is set, this method will start a new container and run the process in it. Otherwise, this method starts a new process in the existing container.

type Process

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

Process provides methods to control a process.

func (*Process) Done

func (p *Process) Done() <-chan error

Done returns a channel where error or nil will be sent when the process exits. TODO: change this to Wait()

func (*Process) ForwardIO

func (p *Process) ForwardIO(in *ioset.In, ioCancelCallback func())

ForwardIO forwards process's io to the specified reader/writer. Optionally specify ioCancelCallback which will be called when the process closes the specified IO. This will be useful for additional cleanup.

Source Files

processes.go

Version
v0.15.0-rc2
Published
Jun 6, 2024
Platform
js/wasm
Imports
8 packages
Last checked
11 hours ago

Tools for package owners.