cronjob

package
v2.0.0-beta9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Clock      clockwork.Clock = clockwork.NewRealClock()
	LeaderKey                  = "cronjob:leader"
	DefaultTTL                 = 10 * time.Minute
)

Functions

func New

func New(lc lifecycle.Lifecycle, cmder redis.Cmdable) (gocron.Scheduler, error)

Types

type DistributedElector

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

func NewDistributedElector

func NewDistributedElector(cmder redis.Cmdable) *DistributedElector

func (*DistributedElector) IsLeader

func (e *DistributedElector) IsLeader(ctx context.Context) error

func (*DistributedElector) Lock

func (e *DistributedElector) Lock(ctx context.Context, key string) (gocron.Lock, error)

func (*DistributedElector) Stop

func (e *DistributedElector) Stop(ctx context.Context)

func (*DistributedElector) Unlock

func (e *DistributedElector) Unlock(ctx context.Context, key string) error

Jump to

Keyboard shortcuts

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