runmanager

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInterruptHandler

func RunInterruptHandler(m *RunManager)

RunInterruptHandler runs an interrupt handler ontop of the RunManager.

func RunServices

func RunServices(services []Service)

RunServices starts up all given services.

Types

type RunManager

type RunManager struct {
	Context              context.Context
	WaitingGroupShutdown *sync.WaitGroup
	ErrChan              chan<- error
	Cancel               func()
}

RunManager can Run services while managing startup and Shutdown.

func (*RunManager) Run

func (m *RunManager) Run(r *Runner)

Run runs the Runner.

func (*RunManager) RunInterruptHandler

func (m *RunManager) RunInterruptHandler()

RunInterruptHandler runs an interrupt handler ontop of the RunManager.

type Runner

type Runner struct {
	Run      func() error
	Shutdown func() error
}

Runner incorporates a Run and a Shutdown method to control a service.

type Service

type Service func(m *RunManager)

Service is a runnable service.

Directories

Path Synopsis
runnables

Jump to

Keyboard shortcuts

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