task

package
v0.0.0-...-35d01cd Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(UserID uint, tasks ...Job) (int, error)

func Recover

func Recover(logger cron.Logger) cron.JobWrapper

func Remove

func Remove(name string)

func Start

func Start()

std is the default process.

func Stop

func Stop() context.Context

Types

type EntryID

type EntryID int

type Job

type Job interface {
	cron.Job
	Name() string // unique field
	Attribute() interface{}
	SetStatus(basetask.Status)
	GetStatus() basetask.Status
	Data() interface{}
	Spec() string
}

Job is the interface that wraps the basic Run method.

type Process

type Process struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...cron.Option) *Process

func (*Process) Add

func (P *Process) Add(UserID uint, tasks ...Job) (int, error)

func (*Process) Remove

func (P *Process) Remove(name string)

func (*Process) Start

func (P *Process) Start()

func (*Process) Stop

func (P *Process) Stop() context.Context

func (*Process) Task

func (P *Process) Task(name string) *TaskWrapper

func (*Process) Tasks

func (P *Process) Tasks() []TaskWrapper

type TaskWrapper

type TaskWrapper struct {
	EntryID
	Name string

	Type string
	// contains filtered or unexported fields
}

func Task

func Task(name string) *TaskWrapper

func Tasks

func Tasks() []TaskWrapper

func (*TaskWrapper) Task

func (tw *TaskWrapper) Task() Job

Jump to

Keyboard shortcuts

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