schedule

package
v1.0.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stop          = Type(0)
	Once          = Type(1)
	Timing        = Type(2)
	OnceAndTiming = Type(3)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type        Type   `config:"type" desc:"Stop: 0, Once: 1, Timing: 2, OnceAndTiming: 3"`
	Spec        string `config:"spec" desc:"Cron spec info"`
	Compete     bool   `config:"compete" desc:"Only winner can exec schedule"`
	AutoUnlock  bool   `config:"autoUnlock" desc:"Auto unlock after task finish"`
	LockSeconds int    `config:"lockSeconds" desc:"Lock ttl"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(key string) *Config

func StdConfig

func StdConfig(key string) *Config

func (*Config) Build

func (c *Config) Build(optionFunc ...OptionFunc) *Schedule

func (*Config) Path

func (c *Config) Path() string

type Handler

type Handler func() error

type OptionFunc

type OptionFunc func(*Config)

func WithHandler

func WithHandler(onceHandler, timingHandler Handler) OptionFunc

func WithLocker

func WithLocker(locker locker.MutexLocker) OptionFunc

type Schedule

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

type Type

type Type int

Jump to

Keyboard shortcuts

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