timewheel

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

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

type TimeWheel

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

func NewTimeWheel

func NewTimeWheel(timeWheelNum int, slotNum []int, delta, currentTicks int64, totalDataNum int32) *TimeWheel

func NewTimeWheelBinaryBits

func NewTimeWheelBinaryBits(timeWheelNum int, slotNumBit []int, delta, currentTicks int64, totalDataNum int32) *TimeWheel

func (*TimeWheel) Add

func (this *TimeWheel) Add(interval int64, data interface{}, callBack TimeWheelCallBack) int32

func (*TimeWheel) AddCycle

func (this *TimeWheel) AddCycle(interval int64, data interface{}, callBack TimeWheelCallBack) int32

func (*TimeWheel) Remove

func (this *TimeWheel) Remove(id int32) bool

func (*TimeWheel) RemoveAll

func (this *TimeWheel) RemoveAll()

func (*TimeWheel) Size

func (this *TimeWheel) Size() int32

func (*TimeWheel) Step

func (this *TimeWheel) Step(current int64)

func (*TimeWheel) StepOne

func (this *TimeWheel) StepOne()

func (*TimeWheel) String

func (this *TimeWheel) String() string

type TimeWheelAllocator

type TimeWheelAllocator struct {
	Chunks []Chunk
	// contains filtered or unexported fields
}

func NewTimeWheelAllocator

func NewTimeWheelAllocator(capacity int32) *TimeWheelAllocator

func (*TimeWheelAllocator) Alloc

func (this *TimeWheelAllocator) Alloc() int32

func (*TimeWheelAllocator) AllocEx

func (this *TimeWheelAllocator) AllocEx() *Chunk

func (*TimeWheelAllocator) Free

func (this *TimeWheelAllocator) Free(id int32)

func (*TimeWheelAllocator) FreeAll

func (this *TimeWheelAllocator) FreeAll()

type TimeWheelAllocatorStat

type TimeWheelAllocatorStat struct {
	Alloc   uint64
	AllocOk uint64
	Free    uint64
	FreeOk  uint64
	FreeAll uint64
}

type TimeWheelCallBack

type TimeWheelCallBack func(val interface{})

type TimeWheelStat

type TimeWheelStat struct {
	Add              uint64
	AddOk            uint64
	InternalAdd      uint64
	InternalAddOk    uint64
	Remove           uint64
	RemoveOk         uint64
	InternalRemove   uint64
	InternalRemoveOk uint64
	Step             uint64
	Expire           uint64
	ExpireBeforeAdd  uint64
	Post             uint64
	RemoveAll        uint64
	MoveWheels       uint64
	MoveSlot         uint64
}

func (*TimeWheelStat) Clear

func (this *TimeWheelStat) Clear()

type TimeWheelTaskData

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

Jump to

Keyboard shortcuts

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