mutex

package
v2.15.5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocked = errors.New("crontab/jobwrapper/mutex: job is locked")

Functions

func SkipIfStillMutexRunning

func SkipIfStillMutexRunning(opts ...Option) cron.JobWrapper

Types

type ExpirableJob

type ExpirableJob features.Expirable

type Job

type Job interface {
	cron.Job
	features.Slug

	IsMutexJob()
}

type Locker

type Locker interface {
	Lock(slug string, expiration time.Duration) error
	Unlock(slug string) error
}

type MutexJob

type MutexJob struct{} //nolint:revive

func (*MutexJob) IsMutexJob

func (m *MutexJob) IsMutexJob()

type Option

type Option func(*options)

func WithExpiration

func WithExpiration(expiration time.Duration) Option

func WithLocker

func WithLocker(locker Locker) Option

func WithLogger

func WithLogger(logger cron.Logger) Option

func WithPrefix

func WithPrefix(prefix string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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