adaptiveticker

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const UnknownId = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptiveTicker

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

func NewAdaptiveTicker

func NewAdaptiveTicker() *AdaptiveTicker

func (*AdaptiveTicker) Create

func (a *AdaptiveTicker) Create(target chan *TimerHandler, event interface{}, first int64, interval int64, count int64) int

func (*AdaptiveTicker) Quit

func (a *AdaptiveTicker) Quit()

func (*AdaptiveTicker) Remove

func (a *AdaptiveTicker) Remove(tids []int) bool

type IIds

type IIds interface {
	SetId(int)
	Unset()
}

type Ids

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

func NewIds

func NewIds(max int) *Ids

func (*Ids) All

func (a *Ids) All() *list.List

func (*Ids) Get

func (a *Ids) Get(id int) (IIds, bool)

func (*Ids) Set

func (a *Ids) Set(obj IIds) int

func (*Ids) Unset

func (a *Ids) Unset(id int) bool

type Session

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

func NewSession

func NewSession(acquireFn []func(), releaseFn []func()) *Session

func (*Session) Acquire

func (s *Session) Acquire()

func (*Session) Now

func (s *Session) Now() int64

func (*Session) Release

func (s *Session) Release()

type TimerGroupHandler

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

func NewGroupEvent

func NewGroupEvent(event *TimerHandler) *TimerGroupHandler

func (*TimerGroupHandler) Add

func (g *TimerGroupHandler) Add(event *TimerHandler)

type TimerHandler

type TimerHandler struct {
	Event interface{}
	// contains filtered or unexported fields
}

func NewTimerHandler

func NewTimerHandler(target chan *TimerHandler, event interface{}, first int64, interval int64, loopCount int64, min int64) *TimerHandler

func (*TimerHandler) IsUsable

func (t *TimerHandler) IsUsable() bool

func (*TimerHandler) PostEvent

func (t *TimerHandler) PostEvent()

func (*TimerHandler) Prepare

func (t *TimerHandler) Prepare(now int64)

func (*TimerHandler) SetId

func (t *TimerHandler) SetId(id int)

func (*TimerHandler) Unset

func (t *TimerHandler) Unset()

type TimerMode

type TimerMode int
const (
	TimerModeContinuous TimerMode = iota
	TimerModeCounter    TimerMode = iota
)

Jump to

Keyboard shortcuts

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