timer

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timer

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

func NewTimer

func NewTimer(timerId string, client *rds.Pool, fn func(token string, tm time.Duration), delaySeconds int64) *Timer

delaySeconds 全局默认延迟时间,单位秒

func (*Timer) Add

func (this *Timer) Add(token string, delaySeconds int64) (err error)

delaySeconds 局部延迟时间,单位秒。当未设置时使用全局延迟时间

func (*Timer) Close

func (this *Timer) Close() (err error)

func (*Timer) Start

func (this *Timer) Start(interval time.Duration)

func (*Timer) Stop

func (this *Timer) Stop()

Jump to

Keyboard shortcuts

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