rununit

package
v1.9.22 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Unlicense, ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunUnit

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

RunUnit handles correctly starting and stopping child processes that have StdConn pipe logging enabled, allowing custom hooks to run on start and stop,

func New

func New(
	run, stop func(),
	logger func(ent *logi.Entry) (e error),
	pkgFilter func(pkg string) (out bool),
	quit qu.C,
	args ...string,
) (r *RunUnit)

New creates and starts a new rununit. run and stop functions are executed after starting and stopping. logger receives log entries and processes them (such as logging them).

func (*RunUnit) Running

func (r *RunUnit) Running() bool

Running returns whether the unit is running

func (*RunUnit) Shutdown

func (r *RunUnit) Shutdown()

Shutdown terminates the run unit

func (*RunUnit) ShuttingDown

func (r *RunUnit) ShuttingDown() bool

ShuttingDown returns true if the server is shuting down

func (*RunUnit) Start

func (r *RunUnit) Start()

Start signals the run unit to start

func (*RunUnit) Stop

func (r *RunUnit) Stop()

Stop signals the run unit to stop

Jump to

Keyboard shortcuts

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