Documentation ¶
Overview ¶
Example ¶
package main import ( "fmt" "time" "github.com/danielkraic/idmapper/scheduler" ) type FirstJob struct { } func (firstJob FirstJob) Run() { fmt.Printf("FirstJob called\n") } func SecondJobFunc() { fmt.Printf("SecondJob called\n") } func main() { scheduler := scheduler.Scheduler{} //scheduler.Add(&FirstJob{}, 100*time.Millisecond) err := scheduler.AddFunc(SecondJobFunc, 300*time.Millisecond) if err != nil { panic(err) } go scheduler.Start() time.Sleep(time.Second) scheduler.Stop() }
Output: SecondJob called SecondJob called SecondJob called
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler to run periodic jobs
Click to show internal directories.
Click to hide internal directories.