tasks

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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