sys

package
v0.0.0-...-724b653 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LuaAddTasks = `` /* 797-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type RTaskElement

type RTaskElement struct {
	CallbackUrl string            // 回调url
	Method      string            // 回调方法
	Req         interface{}       // 回调参数
	Header      map[string]string // 回调header
	// contains filtered or unexported fields
}

type RTimeWheel

type RTimeWheel struct {
	sync.Once
	// contains filtered or unexported fields
}

func NewRTimeWheel

func NewRTimeWheel(redisClient *redis.Client, httpClient *http.Client) *RTimeWheel

func (*RTimeWheel) AddTask

func (r *RTimeWheel) AddTask(ctx context.Context, key string, task *RTaskElement, executeAt time.Time) error

func (*RTimeWheel) Stop

func (r *RTimeWheel) Stop()

type TimeWheel

type TimeWheel struct {
	sync.Once // 只执行一次
	// contains filtered or unexported fields
}

时间轮

func NewTimeWheel

func NewTimeWheel(soltNum int, interval time.Duration) *TimeWheel

func (*TimeWheel) AddTask

func (t *TimeWheel) AddTask(key string, task func(), executeAt time.Time)

func (*TimeWheel) RemoveTask

func (t *TimeWheel) RemoveTask(key string)

func (*TimeWheel) Stop

func (t *TimeWheel) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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