tasks

package
v0.6.22 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogErr

func LogErr(f func() error) func()

func RunTaskAsDaemon

func RunTaskAsDaemon(tasks []Task, brevHome string) error

func RunTasks

func RunTasks(tasks []Task) error

Types

type Task

type Task interface {
	Run() error
	GetTaskSpec() TaskSpec
}

type TaskRunner

type TaskRunner struct {
	Tasks       []Task
	StopSignals chan os.Signal
}

func NewTaskRunner

func NewTaskRunner(tasks []Task) *TaskRunner

func (TaskRunner) Run

func (tr TaskRunner) Run() error

func (*TaskRunner) SendStop

func (tr *TaskRunner) SendStop()

func (TaskRunner) WaitTillSignal

func (tr TaskRunner) WaitTillSignal(ctxfn func() context.Context)

type TaskSpec

type TaskSpec struct {
	Cron               string // can be "" if want to run once // https://pkg.go.dev/github.com/robfig/cron?utm_source=godoc#hdr-CRON_Expression_Format
	RunCronImmediately bool   // only applied if cron not ""
}

Jump to

Keyboard shortcuts

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