minion

package
v0.0.0-...-2d29fd2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConf = conf{
	TickDuration: time.Second,
	InitStrategy: InitAtLeastOnce,
	ErrorHandler: func(err error) {},
	ProcPrinter:  func(w Minion, str string, round int64) {},
}

Functions

This section is empty.

Types

type InitStrategy

type InitStrategy byte
const (
	InitAtLeastOnce InitStrategy = 0
	InitAsync       InitStrategy = 1
)

type Minion

type Minion interface {
	Name() string
	ID() string
	Close()
	IsFinished() bool
}

func New

func New(name string, fnWorkload delegate.Handler, opts ...Option) Minion

type Option

type Option func(c conf) conf

func WithErrorHandler

func WithErrorHandler(fn func(err error)) Option

func WithInitStrategy

func WithInitStrategy(strategy InitStrategy) Option

func WithProcPrinter

func WithProcPrinter(fn func(w Minion, str string, round int64)) Option

func WithTickDuration

func WithTickDuration(duration time.Duration) Option

Jump to

Keyboard shortcuts

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