Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleTimeWheel ¶
type SimpleTimeWheel[T any] struct { // contains filtered or unexported fields }
简单时间轮
func NewSimpleTimeWheel ¶
func NewSimpleTimeWheel[T any](delay time.Duration, numSlot int, handler SimpleHandler[T]) *SimpleTimeWheel[T]
func (*SimpleTimeWheel[T]) Add ¶
func (t *SimpleTimeWheel[T]) Add(key string, value T, delay time.Duration)
添加任务
func (*SimpleTimeWheel[T]) Remove ¶
func (t *SimpleTimeWheel[T]) Remove(key string)
func (*SimpleTimeWheel[T]) Stop ¶
func (t *SimpleTimeWheel[T]) Stop()
Click to show internal directories.
Click to hide internal directories.