schedule

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgOption added in v0.2.13

type ArgOption func(*scheduleArgs)

func OnOneServer added in v0.2.13

func OnOneServer(rdb *redis.Client, key string, ttl time.Duration) ArgOption

type AutoLock added in v0.2.13

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

func TryLock added in v0.2.13

func TryLock(ctx context.Context, rdb *redis.Client, key string, ttl time.Duration) (*AutoLock, error)

TryLock attempts to acquire a distributed lock and starts automatic renewal.

func (*AutoLock) Release added in v0.2.13

func (al *AutoLock) Release(ctx context.Context) error

Release stops the auto-renewal process and releases the lock.

type Schedule

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

func NewSchedule

func NewSchedule(logger log.Logger) *Schedule

func (Schedule) Add

func (s Schedule) Add(name string, spec string, job func() error, opts ...ArgOption) (cron.EntryID, error)

func (Schedule) AddCtx added in v0.2.13

func (s Schedule) AddCtx(ctx context.Context, name string, spec string, job func(ctx2 context.Context) error, opts ...ArgOption) (cron.EntryID, error)

func (Schedule) Start

func (s Schedule) Start() error

func (Schedule) Stop

func (s Schedule) Stop() error

Jump to

Keyboard shortcuts

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