gofw_timewheel

package module
v0.0.0-...-be4b70e Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 3 Imported by: 0

README

gofw-timewheel

gofw-timewheel is a simple time round implementation, through a timer can achieve multiple tasks.

GO START

// Initialize the time wheel
timeWheel := NewDefaultTimeWheel()
// Start time wheel
timeWheel.Start()
// Add tasks
timewheel.Add()
// Close time wheel
timewheel.Stop()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

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

type TaskCallBack

type TaskCallBack func()

type TimeWheel

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

func NewDefaultTimeWheel

func NewDefaultTimeWheel() *TimeWheel

func NewTimeWheel

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

func (*TimeWheel) Add

func (t *TimeWheel) Add(tasks ...*Task)

func (*TimeWheel) Start

func (t *TimeWheel) Start()

func (*TimeWheel) Stop

func (t *TimeWheel) Stop()

Jump to

Keyboard shortcuts

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