worker

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)

Functions

This section is empty.

Types

type Worker

type Worker struct {
	Cmd  *exec.Cmd
	Args []string
	// Stderr  io.WriteCloser
	// StdPipe io.ReadCloser
	StdConn *stdconn.StdConn
}

func Spawn

func Spawn(quit qu.C, args ...string) (w *Worker, e error)

Spawn starts up an arbitrary executable file with given arguments and attaches a connection to its stdin/stdout

func (*Worker) Continue

func (w *Worker) Continue() (e error)

Continue sends a signal to a worker process to resume work

func (*Worker) Interrupt

func (w *Worker) Interrupt() (e error)

func (*Worker) Kill

func (w *Worker) Kill() (e error)

Kill forces the child process to shut down without cleanup

func (*Worker) Pause

func (w *Worker) Pause() (e error)

Pause sends a signal to the worker process to stop

func (*Worker) Stop

func (w *Worker) Stop() (e error)

Stop signals the worker to shut down cleanly.

Note that the worker must have handlers for os.Signal messages.

It is possible and neater to put a quit method in the IPC API and use the quit channel built into the StdConn

func (*Worker) Wait

func (w *Worker) Wait() (e error)

Jump to

Keyboard shortcuts

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