Last active
December 21, 2015 14:32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type BaseScehduler interface { | |
// Create a new periodic job | |
Every(interval uint64) *Job | |
// Create a one time job | |
After(interval uint64) *Job | |
// Remove specific job j | |
Cancel(*Job) bool | |
// Run all the jobs that are scheduled to run. | |
RunPending() | |
// Start starts the scheduler | |
Start() | |
// IsRunning returns true if the job has started | |
IsRunning() bool | |
// Stop stops the scheduler from executing jobs | |
Stop() | |
// Delete all scheduled jobs | |
Clear() | |
} | |
type Scheduler interface { | |
BaseScehduler | |
// Location sets the default location of every job created with `Every`. | |
// The deefault location is `time.Local` | |
Location(*time.Location) | |
// NextRun returns the next next job to be run and the time in which it will be run | |
NextRun() (*Job, time.Time) | |
// RunAll runs all of the jobs regardless of wether or not they are pending | |
RunAll() | |
// RunAllWithDelay runs all of the jobs regardless of wether or not they are pending with a delay | |
RunAllWithDelay(time.Duration) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment