task

package
v0.0.0-...-eedf899 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NowFunc

type NowFunc func() int64

type Q

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

func (*Q) IsEmpty

func (q *Q) IsEmpty() bool

func (*Q) Peek

func (q *Q) Peek() (bool, int64, []*Task)

func (*Q) Pop

func (q *Q) Pop() (bool, int64, []*Task)

func (*Q) Push

func (q *Q) Push(ts int64, task *Task)

type Scheduler

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

func NewScheduler

func NewScheduler() *Scheduler

func (*Scheduler) AddTask

func (s *Scheduler) AddTask(task *Task)

func (*Scheduler) Shutdown

func (s *Scheduler) Shutdown()

func (*Scheduler) Start

func (s *Scheduler) Start() error

type Task

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

func NewTask

func NewTask(id string, cron string, f func()) (*Task, error)

type Type

type Type int
const (
	TypeNone Type = iota
	TypeCron
)

Jump to

Keyboard shortcuts

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