rununit

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Unlicense, ISC Imports: 6 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 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(
	name string, run, stop func(), logger func(ent *log.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