Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeLoc(newLocation *time.Location)
- type Job
- func (j *Job) At(t string) *Job
- func (j *Job) Day() (job *Job)
- func (j *Job) Days() *Job
- func (j *Job) Do(jobFun interface{}, params ...interface{}) *Job
- func (j *Job) Friday() (job *Job)
- func (j *Job) Hour() (job *Job)
- func (j *Job) Hours() (job *Job)
- func (j *Job) Minute() (job *Job)
- func (j *Job) Minutes() (job *Job)
- func (j *Job) Monday() (job *Job)
- func (j *Job) NextScheduledTime() time.Time
- func (j *Job) Run() (result []reflect.Value, err error)
- func (j *Job) Saturday() (job *Job)
- func (j *Job) Second() (job *Job)
- func (j *Job) Seconds() (job *Job)
- func (j *Job) Sunday() (job *Job)
- func (j *Job) Thursday() (job *Job)
- func (j *Job) Tuesday() (job *Job)
- func (j *Job) Wednesday() (job *Job)
- func (j *Job) Weeks() *Job
- type Scheduler
- func (s *Scheduler) Clear()
- func (s *Scheduler) Every(interval uint64) *Job
- func (s *Scheduler) Len() int
- func (s *Scheduler) Less(i, j int) bool
- func (s *Scheduler) NextRun() (*Job, time.Time)
- func (s *Scheduler) Remove(j interface{})
- func (s *Scheduler) RunAll()
- func (s *Scheduler) RunAllwithDelay(d int)
- func (s *Scheduler) RunPending()
- func (s *Scheduler) Start() chan bool
- func (s *Scheduler) Swap(i, j int)
Constants ¶
const MAXJOBNUM = 10000
Max number of jobs, hack it if you need.
Variables ¶
var Default = NewScheduler()
Functions ¶
Types ¶
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
func (*Job) NextScheduledTime ¶
NextScheduledTime returns the time of when this job is to run next
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Class Scheduler, the only data member is the list of jobs.
func (*Scheduler) NextRun ¶
Datetime when the next job should run. NextRun gets the next running time
func (*Scheduler) RunAll ¶
func (s *Scheduler) RunAll()
Run all jobs regardless if they are scheduled to run or not
func (*Scheduler) RunAllwithDelay ¶
Run all jobs with delay seconds
A delay of 'delay' seconds is added between each job. This can help to distribute the system load generated by the jobs more evenly over time.
func (*Scheduler) RunPending ¶
func (s *Scheduler) RunPending()
Run all the jobs that are scheduled to run. Run all jobs that are scheduled to run
Please note that it is *intended behavior that run_pending() does not run missed jobs*. For example, if you've registered a job that should run every minute and you only call run_pending() in one hour increments then your job won't be run 60 times in between but only once.