trigger

package
v1.0.15-0...-55ead4f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorsInvalidTask = errors.New("invalid task")
)

Functions

This section is empty.

Types

type Job

type Job interface {
	Run()
}

type List

type List struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

List represents a doubly linked list. The zero value for List is an empty list ready to use.

func (*List) Front

func (l *List) Front() *item

func (*List) Len

func (l *List) Len() int

Len returns the number of elements of list l. The complexity is O(1).

type Task

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

type TaskList

type TaskList struct {
	List
	// contains filtered or unexported fields
}

type Trigger

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

一分钟代表一个key,一小时60分钟 也就是说同一时间最多60个key

func NewTrigger

func NewTrigger() Trigger

func (Trigger) AddTask

func (t Trigger) AddTask(job Job, triggerAt time.Time) error

func (Trigger) Start

func (t Trigger) Start()

Jump to

Keyboard shortcuts

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