import (
"fmt"
"time"
"github.com/JPZ13/daemon"
)
// plug in any function that takes no arguments
// and returns an error
func action() error {
return nil
}
func main() {
dae := daemon.New(daemon.Config{
Action: action,
Interval: 2 * time.Minute,
})
errCh := dae.Start()
go func() {
for err := range errCh {
fmt.Println("Handling error ", err)
}
}()
time.Sleep(5 * time.Minute)
dae.Stop()
}
-
Notifications
You must be signed in to change notification settings - Fork 0
JPZ13/daemon
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Repository files navigation
About
π Repeat tasks the metal way
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published