Documentation
¶
Index ¶
- func CurrentJobs() map[string]cron.Job
- func Register(ctx context.Context, mc *model.Client, cs JobCreators) (err error)
- func SetupSyncer(ctx context.Context, opts StartSyncerOptions) error
- func Sync(ctx context.Context, m settingbus.BusMessage) error
- type Expr
- type JobCreator
- type JobCreators
- type Lock
- type Locker
- type Option
- type StartSyncerOptions
- type Syncer
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentJobs ¶
CurrentJobs return the currents running jobs.
func Register ¶
Register executes all job creators and schedules the returning task with the returning expression.
func SetupSyncer ¶
func SetupSyncer(ctx context.Context, opts StartSyncerOptions) error
func Sync ¶
func Sync(ctx context.Context, m settingbus.BusMessage) error
Sync observes the cron expr setting changes and re-register jobs.
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, the life of given context.Context ends by this creation, do not use the long-term processing with this context.Context.
type JobCreators ¶
type JobCreators map[string]JobCreator
JobCreators holds JobCreator with its name.
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.