proc

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

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

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Signal = "signal"
	Exit   = "exit"
	Error  = "error"
)

Variables

This section is empty.

Functions

func New

func New() *process

func NewWithContext

func NewWithContext(wg *sync.WaitGroup, ctx context.Context, ctxCancel context.CancelFunc) *process

Types

type Worker

type Worker struct {
	Name     string
	StopCtx  context.Context
	WG       *sync.WaitGroup
	Fn       func(w *Worker)
	Interval time.Duration
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(name string, ctx context.Context, wg *sync.WaitGroup, fns ...func(w *Worker)) *Worker

func (*Worker) DefaultEvent

func (w *Worker) DefaultEvent() *Worker

func (*Worker) Off

func (w *Worker) Off(e event) *Worker

func (*Worker) On

func (w *Worker) On(e event, fn func(w *Worker, others ...interface{})) *Worker

-----------------------------------------------------------------------------

func (*Worker) Run

func (w *Worker) Run()

func (*Worker) RunInterval

func (w *Worker) RunInterval()

func (*Worker) SetFunc

func (w *Worker) SetFunc(fn func(g *Worker)) *Worker

func (*Worker) SetInterval

func (w *Worker) SetInterval(interval time.Duration)

Jump to

Keyboard shortcuts

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