timerjob

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 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 BaseTimerJob

type BaseTimerJob struct {
	Interval time.Duration
	Worker   func()
	// contains filtered or unexported fields
}

func (*BaseTimerJob) Run

func (j *BaseTimerJob) Run()

func (*BaseTimerJob) Stop

func (j *BaseTimerJob) Stop()

type RedisLockerJob

type RedisLockerJob struct {
	BaseTimerJob

	Redis      *redis.Client
	LockID     string
	LockExpire time.Duration
}

func (*RedisLockerJob) Run

func (j *RedisLockerJob) Run()

func (*RedisLockerJob) Stop

func (j *RedisLockerJob) Stop()

type TimerJob

type TimerJob interface {
	Run()
	Stop()
}

type TimerJobList

type TimerJobList struct {
	sync.WaitGroup
	Jobs []TimerJob
}

func (*TimerJobList) AddJob

func (l *TimerJobList) AddJob(job ...TimerJob)

func (*TimerJobList) Start

func (l *TimerJobList) Start()

func (*TimerJobList) Stop

func (l *TimerJobList) Stop()

Jump to

Keyboard shortcuts

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