basetask

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTask

type BaseTask struct{}

func (BaseTask) RunLoop

func (b BaseTask) RunLoop(handlerFunc func(), interval ...time.Duration)

func (BaseTask) RunLoopWithLock added in v1.6.0

func (b BaseTask) RunLoopWithLock(handlerFunc func(), opts ...RunLoopOption)

func (BaseTask) Wait

func (b BaseTask) Wait(cb func())

type LoopArg added in v1.6.0

type LoopArg struct {
	Interval     time.Duration
	LockKey      string
	LockConf     string
	LockInterval time.Duration
	LockTTL      int64
}

type RunLoopOption added in v1.6.0

type RunLoopOption func(arg *LoopArg)

func WithInterval added in v1.6.0

func WithInterval(interval time.Duration) RunLoopOption

func WithLockConf added in v1.6.0

func WithLockConf(confName string) RunLoopOption

func WithLockInterval added in v1.6.0

func WithLockInterval(interval time.Duration) RunLoopOption

func WithLockKey added in v1.6.0

func WithLockKey(key string) RunLoopOption

func WithLockTTL added in v1.6.0

func WithLockTTL(ttl int64) RunLoopOption

Jump to

Keyboard shortcuts

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