This package is a library of ZKits project. This library provides a convenient subtask runner for applications. We can easily control the running order of subtasks and exit them in reverse order.
go get -u -v github.com/edoger/zkits-runner
package main
import (
"github.com/edoger/zkits-runner"
)
func main() {
r := runner.New()
err := r.Run(runner.NewTaskFromFunc(nil, func() error {
// Do something.
return nil
}))
// Wait system exit.
if err := r.Wait(); err != nil {
// Handle error.
}
}