timewheel

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At

func At(at time.Time, key string, job func())

func Cancel

func Cancel(key string)

func Delay

func Delay(duration time.Duration, key string, job func())

Types

type Task

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

type TimeWheel

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

func New

func New(interval time.Duration, slotNum int) *TimeWheel

func (*TimeWheel) AddTimer

func (tw *TimeWheel) AddTimer(delay time.Duration, key string, job func())

func (*TimeWheel) RemoveTimer

func (tw *TimeWheel) RemoveTimer(key string)

func (*TimeWheel) Start

func (tw *TimeWheel) Start()

func (*TimeWheel) Stop

func (tw *TimeWheel) Stop()

Jump to

Keyboard shortcuts

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