Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 370 Bytes

README.md

File metadata and controls

29 lines (20 loc) · 370 Bytes

Usage

Looper executes the provided function once in while and collects any errors.

Example

package main 

import (
	"github.com/donutloop/toolkit/looper"
	"log"
)


func main() {
	l := loop.NewLooper(1*time.Millisecond, func() error {
		// do things
		return nil
	})

	for err := range l.Error() {
		log.Println(err)
	}
	
	// stop call is missing
}