ticker

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ticker 定时队列模块

Index

Constants

View Source
const (
	// IdleDuration 定时器精度,NewQueue时传入的Duration为该数值的整数倍
	IdleDuration = time.Millisecond * 10
)

IdleDuration ...

Variables

This section is empty.

Functions

func Stop

func Stop()

Stop ...

Types

type Bucket

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

Bucket ...

func (*Bucket) Insert

func (b *Bucket) Insert(obj interface{}) error

Insert ...

func (*Bucket) Remove

func (b *Bucket) Remove(obj interface{})

Remove ...

type Handler

type Handler func(v interface{})

Handler 响应处理函数

type HandlerWithRound

type HandlerWithRound func(interface{}, int)

HandlerWithRound 响应处理函数

type Queue

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

Queue ...

func NewQueue

func NewQueue(duration time.Duration, h Handler, useRoutine bool) *Queue

NewQueue 创建��的Ticker队列

func (*Queue) Insert

func (q *Queue) Insert(obj interface{}) error

Insert ...

func (*Queue) Remove

func (q *Queue) Remove(obj interface{})

Remove ...

Directories

Path Synopsis
Package ticker 定时队列
Package ticker 定时队列