Versions in this module Expand all Collapse all v1 v1.0.0 Oct 6, 2026 Changes in this version + const Cron + const Date + const Interval + func RegisterTrigger(name string, proto Trigger) error + type Args []interface + func (a *Args) Scan(val interface{}) error + func (a Args) Value() (driver.Value, error) + type ConcurrencyPolicy int + const ConcurrencyBlock + const ConcurrencySkip + type CronTrigger struct + Cron string + EndTime time.Time + StartTime time.Time + func (t *CronTrigger) Build(p PeriodicTask) (Trigger, error) + func (t *CronTrigger) Next(prev time.Time) time.Time + func (t *CronTrigger) Type() string + type DateTrigger struct + StartTime time.Time + func (t *DateTrigger) Build(p PeriodicTask) (Trigger, error) + func (t *DateTrigger) Next(prev time.Time) time.Time + func (t *DateTrigger) Type() string + type DelayQueue struct + C chan interface{} + func New(size int) *DelayQueue + func (dq *DelayQueue) Offer(elem interface{}, expiration int64) + func (dq *DelayQueue) Poll(exitC chan struct{}, nowF func() int64) + type Expression struct + func MustParse(cronLine string) *Expression + func Parse(cronLine string) (*Expression, error) + func (expr *Expression) Next(fromTime time.Time) time.Time + func (expr *Expression) NextN(fromTime time.Time, n uint) []time.Time + type IntervalTrigger struct + EndTime time.Time + Interval time.Duration + StartTime time.Time + func (t *IntervalTrigger) Build(p PeriodicTask) (Trigger, error) + func (t *IntervalTrigger) Next(prev time.Time) time.Time + func (t *IntervalTrigger) Type() string + type Options struct + ConcurrencyPolicy ConcurrencyPolicy + DB *gorm.DB + MaxConcurrency int + Storage StorageMode + Tick time.Duration + WheelSize int64 + type PeriodicTask struct + Args Args + Cron string + EndTime time.Time + Function interface{} + Interval string + LimitedAliveCount int64 + Name string + StartTime time.Time + Trigger Trigger + TriggerConfig string + TriggerType string + type SafeMapOfInt struct + M map[interface{}]int64 + func (sm *SafeMapOfInt) Add(s interface{}) + func (sm *SafeMapOfInt) Delete(s interface{}) + func (sm *SafeMapOfInt) GetValue(s interface{}) int64 + func (sm *SafeMapOfInt) Len() int + func (sm *SafeMapOfInt) Total() int64 + type Scheduler struct + Any map[string]interface{} + DB *gorm.DB + RunningCount *SafeMapOfInt + func NewScheduler(db *gorm.DB, tick time.Duration, wheelSize int64) *Scheduler + func NewSchedulerWithOptions(opt Options) (*Scheduler, error) + func (s *Scheduler) ActiveCount() int + func (s *Scheduler) AddTask(key string, p PeriodicTask) error + func (s *Scheduler) AddTaskFunction(structs ...interface{}) + func (s *Scheduler) ContinueTask(key string) error + func (s *Scheduler) InitFromDB() + func (s *Scheduler) MaxConcurrency() int + func (s *Scheduler) Mode() string + func (s *Scheduler) PendingCount() int + func (s *Scheduler) RemoveTask(key string) error + func (s *Scheduler) ResetTask(key string, p PeriodicTask) error + func (s *Scheduler) SetMaxConcurrency(n int) + func (s *Scheduler) Start() + func (s *Scheduler) StartTaskNow(key string) error + func (s *Scheduler) Stats() Stats + func (s *Scheduler) Stop() + func (s *Scheduler) StopTask(key string) error + type Stats struct + Instances int64 + MaxConcurrency int + Pending int + Running int + Skipped int64 + Stopped int + Total int + type StorageMode int + const StorageDB + const StorageMemory + func (m StorageMode) String() string + type Timer struct + type TimingWheel struct + func NewTimingWheel(tick time.Duration, wheelSize int64) *TimingWheel + type Trigger interface + Build func(PeriodicTask) (Trigger, error) + Next func(time.Time) time.Time + Type func() string + func BuildTrigger(p PeriodicTask) (Trigger, error)