runner

package
v0.12.21 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 8 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = newBase // allow to override

Functions

func Init

func Init(r Runner) (err error)

Init a runner.

func Run added in v0.12.0

func Run(r Runner) error

Run a runner and wait it done.

func Start

func Start(r Runner)

Start a runner in the background.

func Stop

func Stop(r Runner)

Stop runner, in most scenario, Stop is notification action to notify the Runner to stop.

func StopAndWait added in v0.9.17

func StopAndWait(r Runner)

StopAndWait notify Runner to stop and wait it done.

Types

type Runner

type Runner interface {
	kvs.NoErrKVS
	log.Logger

	Init() error
	Start() error
	Stop() error

	Name() string
	SetName(string)
	Ctx() context.Context
	SetCtx(context.Context)
	Cancel()

	Inherit(Runner)
	Parent() Runner

	MarkStarted() bool
	MarkStopping() bool
	MarkStopDone() bool
	MarkDone() bool
	Started() <-chan struct{}
	Stopping() <-chan struct{}
	StopDone() <-chan struct{}
	Done() <-chan struct{}

	AppendError(err ...error)
	Err() error

	WithLoggerFrom(r Runner, kvs ...any)
}

Jump to

Keyboard shortcuts

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