timingwheel

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Executor = func(f func()) {
	go f()
}

Functions

This section is empty.

Types

type Task

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

func (*Task) Callback

func (s *Task) Callback(f func())

func (*Task) Cancel

func (s *Task) Cancel()

func (*Task) TTL

func (s *Task) TTL() int64

type TimingWheel

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

TimingWheel the timing wheel ticker implementation

func NewTimingWheel

func NewTimingWheel(interval time.Duration, wheels int, slots int) *TimingWheel

func (*TimingWheel) After

func (w *TimingWheel) After(timeout time.Duration) *Task

func (*TimingWheel) Stop

func (w *TimingWheel) Stop()

Jump to

Keyboard shortcuts

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