periodic/periodic.go
func Tick(interval time.Duration, procfunc gp.ProcessFunc) gp.Process {
	return gp.Go(func(proc gp.Process) {
		ticker := time.NewTicker(interval)
		callOnTicker(ticker.C, procfunc)(proc)
		ticker.Stop()
	})
}
func Tick(interval time.Duration, procfunc gp.ProcessFunc) gp.Process {
	return gp.Go(func(proc gp.Process) {
		ticker := time.NewTicker(interval)
		callOnTicker(ticker.C, procfunc)(proc)
		ticker.Stop()
	})
}
func Tick ( interval time . Duration , procfunc gp . ProcessFunc ) gp . Process { return gp . Go ( func ( proc gp . Process ) { ticker := time . NewTicker ( interval ) callOnTicker ( ticker . C , procfunc ) ( proc ) ticker . Stop ( ) } ) }
// Tick constructs a ticker with interval, and calls the given ProcessFunc every
// time the ticker fires.
// This is sequentially rate limited, only one call will be in-flight at a time.
//
//  p := periodicproc.Tick(time.Second, func(proc goprocess.Process) {
//  	fmt.Println("fire!")
//  })
//
//  <-time.After(3 * time.Second)
//  p.Close()
//
//  // Output:
//  // fire!
//  // fire!
//  // fire!
Tick constructs a ticker with interval and calls the given ProcessFunc every time the ticker fires . This is sequentially rate limited only one call will be in - flight at a time . p : = periodicproc . Tick ( time . Second func ( proc goprocess . Process ) { fmt . Println ( fire! ) } ) < - time . After ( 3 * time . Second ) p . Close () // Output : // fire! // fire! // fire!