tasks

package
v0.0.0-...-c36d36f Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MAGIC_DELTA = float64(600) // seconds

TODO: turn into a pref

Variables

This section is empty.

Functions

func CloneValue

func CloneValue(source interface{}, destin interface{})

Types

type Cron

type Cron struct {
	Config *utils.Config
	// contains filtered or unexported fields
}

Launch a bunch of sequentail tasks when their time is due

func NewCron

func NewCron(ctx context.Context, mis SequentialTasks, config *utils.Config) *Cron

Create a new timed task

func (*Cron) Run

func (c *Cron) Run()

Run the Crontask or schedule to run it later.

func (*Cron) Update

func (c *Cron) Update(st SequentialTasks)

Update the tasks channel so listeners can execute the new job order

type SequentialTasks

type SequentialTasks []Task

Tasks that are sequentially executed

type Task

type Task interface {
	Start() time.Time
	Name() string
	End() time.Time
	Execute(*utils.Config) error //A Task has to be able to be run
}

Things that satisfy this interface can be executed as a Task

Jump to

Keyboard shortcuts

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