Documentation ¶
Index ¶
- func Register(ctx context.Context, mc *model.Client, cs JobCreators) (err error)
- func StartCorrecter(ctx context.Context, opts StartCorrecterOptions) error
- func Sync(ctx context.Context, m settingbus.BusMessage) error
- type Expr
- type JobCreator
- type JobCreators
- type JobExpressionName
- type Lock
- type Locker
- type Option
- type StartCorrecterOptions
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register executes all job creators and schedules the returning task with the returning expression.
func StartCorrecter ¶ added in v0.3.1
func StartCorrecter(ctx context.Context, opts StartCorrecterOptions) error
StartCorrecter starts a corrector to calibrate the jobs.
func Sync ¶
func Sync(ctx context.Context, m settingbus.BusMessage) error
Sync observes the cron expr setting changes, and replaces the jobs that have changed expression.
Types ¶
type Expr ¶
Expr holds the definition of cron expression.
func AwaitedExpr ¶
AwaitedExpr returns an Expr and runs in the next round.
func ImmediateExpr ¶
ImmediateExpr returns an Expr and runs in the next round.
type JobCreator ¶
JobCreator is the creator for creating {cron.Expr, cron.Task} tuple.
type JobCreators ¶
type JobCreators map[JobExpressionName]JobCreator
JobCreators holds JobCreator with its expression name.
type JobExpressionName ¶ added in v0.3.1
type JobExpressionName = string
JobExpressionName holds the name of the cron.Expr.
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock implement the cronjob go-co-op/gocron Lock interface.
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker implement the cronjob go-co-op/gocron Locker interface.
type Option ¶
type Option func(*Locker)
Option is a function that configures a locker.
func WithExpiryInterval ¶
WithExpiryInterval can be used to set the expiry of a locker to set to every key.
func WithRenewConfig ¶
WithRenewConfig can be used to set renew interval and max execute duration of a locker.