runner

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &app.Component{
	Dependencies: app.Components{
		logger.Component,
		closer.OsSignalComponent,
	},
	Constructor: func(container container.Container) error {
		return container.Provide(New)
	},
	Serve: func(c container.Container) error {
		runner, err := container.Get[Runner](c)
		if err != nil {
			return err
		}

		return runner.Serve()
	},
}
View Source
var (
	ShutdownError = errors.New("runner: shutdown")
)

Functions

This section is empty.

Types

type Process

type Process interface {
	Process(ctx context.Context) error
	Name() string
}

type Runner

type Runner interface {
	Serve() error
	AddProcesses(processes ...Process) error
}

func New

func New(closer closer.Closer, logger logger.Logger) Runner

Jump to

Keyboard shortcuts

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