Skip to content

edoger/zkits-runner

Repository files navigation

ZKits Runner Library

ZKits Build Status Build status Coverage Status Codacy Badge Go Report Card Golang Version

About

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.

Install

go get -u -v github.com/edoger/zkits-runner

Usage

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.
    }
}

License

Apache-2.0