trc

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateCanceled = "Canceled"
	StateStarted  = "Started"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ITask

type ITask interface {
	GetCode() string         // 获取代码
	GetBeginTime() time.Time // 获取开始时间
	GetEndTime() time.Time   // 获取结束时间
	GetCount() int           // 获取数量
}

任务接口

type Trc

type Trc[T ITask] struct {
	*svc.CacheSvc
	// contains filtered or unexported fields
}

分时量比控制

func NewTrc

func NewTrc[T ITask](prefix string, timeshares [24]int) *Trc[T]

构造函数

func (*Trc[T]) Clean added in v1.0.17

func (t *Trc[T]) Clean(duration time.Duration) error

清理

func (*Trc[T]) GetState

func (t *Trc[T]) GetState(task T) string

获取状态

func (*Trc[T]) Run

func (t *Trc[T]) Run(tasks []T, process func(T) error) error

运行

Jump to

Keyboard shortcuts

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